C# Class OTAPI.Sockets.PoolSocket

Inheritance: global::Terraria.Net.Sockets.ISocket
ファイルを表示 Open project: DeathCradle/Open-Terraria-API Class Usage Examples

Public Methods

Method Description
AsyncReceive ( byte data, int offset, int count, SocketReceiveCallback callback, object state = null ) : void
AsyncSend ( byte data, int offset, int count, SocketSendCallback callback, object state = null ) : void
Close ( ) : void
Connect ( RemoteAddress address ) : void
GetRemoteAddress ( ) : RemoteAddress
IsConnected ( ) : bool
IsDataAvailable ( ) : bool
PoolSocket ( ) : System
PoolSocket ( Socket socket ) : System.Net
StartListening ( SocketConnectionAccepted callback ) : bool
StopListening ( ) : void

Protected Methods

Method Description
OnReceiveComplete ( ReceiveEventArgs arg ) : void
OnSendComplete ( SendEventArgs arg ) : void
Send ( Message message ) : void
SendData ( SendEventArgs args ) : SendResult
StartReceiving ( ) : void
TrySend ( ) : void

Private Methods

Method Description
DrainThread ( ) : void

The purpose of this thread is to look for each instance of PoolSocket and to flush data to be sent to the client. This method might change as i'm testing it not being on the server thread

Flush ( ) : void
ISocket ( ) : void
ListenThread ( object state ) : void
ReceiveData ( ) : void

Method Details

AsyncReceive() public method

public AsyncReceive ( byte data, int offset, int count, SocketReceiveCallback callback, object state = null ) : void
data byte
offset int
count int
callback SocketReceiveCallback
state object
return void

AsyncSend() public method

public AsyncSend ( byte data, int offset, int count, SocketSendCallback callback, object state = null ) : void
data byte
offset int
count int
callback SocketSendCallback
state object
return void

Close() public method

public Close ( ) : void
return void

Connect() public method

public Connect ( RemoteAddress address ) : void
address RemoteAddress
return void

GetRemoteAddress() public method

public GetRemoteAddress ( ) : RemoteAddress
return RemoteAddress

IsConnected() public method

public IsConnected ( ) : bool
return bool

IsDataAvailable() public method

public IsDataAvailable ( ) : bool
return bool

OnReceiveComplete() protected method

protected OnReceiveComplete ( ReceiveEventArgs arg ) : void
arg ReceiveEventArgs
return void

OnSendComplete() protected method

protected OnSendComplete ( SendEventArgs arg ) : void
arg SendEventArgs
return void

PoolSocket() public method

public PoolSocket ( ) : System
return System

PoolSocket() public method

public PoolSocket ( Socket socket ) : System.Net
socket Socket
return System.Net

Send() protected method

protected Send ( Message message ) : void
message Message
return void

SendData() protected method

protected SendData ( SendEventArgs args ) : SendResult
args SendEventArgs
return SendResult

StartListening() public method

public StartListening ( SocketConnectionAccepted callback ) : bool
callback SocketConnectionAccepted
return bool

StartReceiving() protected method

protected StartReceiving ( ) : void
return void

StopListening() public method

public StopListening ( ) : void
return void

TrySend() protected method

protected TrySend ( ) : void
return void