C# Class OpenStory.Server.Networking.SocketAcceptor

Inheritance: IDisposable
Exibir arquivo Open project: shoftee/OpenStory Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
SocketAcceptor ( IPEndPoint endpoint ) : System

Initializes a new instance of the SocketAcceptor class.

Start ( ) : void

Starts the process of accepting connections.

Stop ( ) : void

Halts the process of accepting connections.

Private Methods

Method Description
BeginAccept ( ) : void
DisposeSocketIfNotNull ( ) : void
EndAcceptAsynchronous ( SocketAsyncEventArgs eventArgs ) : void

Handles an asynchronous socket accept operation.

The only difference between this and EndAcceptSynchronous is that this calls BeginAccept if the socket was handled successfully.

EndAcceptSynchronous ( SocketAsyncEventArgs eventArgs ) : bool

Handles a synchronous socket accept operation.

GetAcceptSocket ( ) : Socket
OnSocketAccepted ( Socket acceptedSocket ) : void
OnSocketError ( SocketError error ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

SocketAcceptor() public method

Initializes a new instance of the SocketAcceptor class.
/// Thrown if is . ///
public SocketAcceptor ( IPEndPoint endpoint ) : System
endpoint System.Net.IPEndPoint The to accept connections through.
return System

Start() public method

Starts the process of accepting connections.
/// Thrown if the event has no subscribers. ///
public Start ( ) : void
return void

Stop() public method

Halts the process of accepting connections.
public Stop ( ) : void
return void