C# Class NLog.Internal.NetworkSenders.NetworkSender

A base class for all network senders. Supports one-way sending of messages over various protocols.
Inheritance: IDisposable
ファイルを表示 Open project: NLog/NLog Class Usage Examples

Public Methods

Method Description
CheckSocket ( ) : void
Close ( AsyncContinuation continuation ) : void

Closes the sender and releases any unmanaged resources.

Dispose ( ) : void

Closes the sender and releases any unmanaged resources.

FlushAsync ( AsyncContinuation continuation ) : void

Flushes any pending messages and invokes a continuation.

Initialize ( ) : void

Initializes this network sender.

Send ( byte bytes, int offset, int length, AsyncContinuation asyncContinuation ) : void

Send the given text over the specified protocol.

Protected Methods

Method Description
DoClose ( AsyncContinuation continuation ) : void

Performs sender-specific close operation.

DoFlush ( AsyncContinuation continuation ) : void

Performs sender-specific flush.

DoInitialize ( ) : void

Performs sender-specific initialization.

DoSend ( byte bytes, int offset, int length, AsyncContinuation asyncContinuation ) : void

Actually sends the given text over the specified protocol.

To be overridden in inheriting classes.

NetworkSender ( string url ) : System

Initializes a new instance of the NetworkSender class.

ParseEndpointAddress ( Uri uri, AddressFamily addressFamily ) : EndPoint

Parses the URI into an endpoint address.

Private Methods

Method Description
Dispose ( bool disposing ) : void

Method Details

CheckSocket() public method

public CheckSocket ( ) : void
return void

Close() public method

Closes the sender and releases any unmanaged resources.
public Close ( AsyncContinuation continuation ) : void
continuation AsyncContinuation The continuation.
return void

Dispose() public method

Closes the sender and releases any unmanaged resources.
public Dispose ( ) : void
return void

DoClose() protected method

Performs sender-specific close operation.
protected DoClose ( AsyncContinuation continuation ) : void
continuation AsyncContinuation The continuation.
return void

DoFlush() protected method

Performs sender-specific flush.
protected DoFlush ( AsyncContinuation continuation ) : void
continuation AsyncContinuation The continuation.
return void

DoInitialize() protected method

Performs sender-specific initialization.
protected DoInitialize ( ) : void
return void

DoSend() protected abstract method

Actually sends the given text over the specified protocol.
To be overridden in inheriting classes.
protected abstract DoSend ( byte bytes, int offset, int length, AsyncContinuation asyncContinuation ) : void
bytes byte The bytes to be sent.
offset int Offset in buffer.
length int Number of bytes to send.
asyncContinuation AsyncContinuation The async continuation to be invoked after the buffer has been sent.
return void

FlushAsync() public method

Flushes any pending messages and invokes a continuation.
public FlushAsync ( AsyncContinuation continuation ) : void
continuation AsyncContinuation The continuation.
return void

Initialize() public method

Initializes this network sender.
public Initialize ( ) : void
return void

NetworkSender() protected method

Initializes a new instance of the NetworkSender class.
protected NetworkSender ( string url ) : System
url string The network URL.
return System

ParseEndpointAddress() protected method

Parses the URI into an endpoint address.
protected ParseEndpointAddress ( Uri uri, AddressFamily addressFamily ) : EndPoint
uri System.Uri The URI to parse.
addressFamily AddressFamily The address family.
return System.Net.EndPoint

Send() public method

Send the given text over the specified protocol.
public Send ( byte bytes, int offset, int length, AsyncContinuation asyncContinuation ) : void
bytes byte Bytes to be sent.
offset int Offset in buffer.
length int Number of bytes to send.
asyncContinuation AsyncContinuation The asynchronous continuation.
return void