C# Class Cosockets.Cosocket

Mostrar archivo Open project: sublee/unity-cosocket Class Usage Examples

Protected Properties

Property Type Description
socket Socket
token uint
waiting HashSet

Public Methods

Method Description
Accept ( ) : IEnumerator
Bind ( EndPoint localEP ) : void
Close ( int timeout ) : void
Connect ( EndPoint remoteEP ) : IEnumerator
Connect ( IPAddress address, int port ) : IEnumerator
Cosocket ( AddressFamily family, SocketType sockType, ProtocolType protType ) : System
Cosocket ( Socket socket ) : System
Cosocket ( SocketInformation info ) : System
Disconnect ( bool reuseSocket = false ) : IEnumerator
Listen ( int backlog ) : void
Receive ( IList buffers, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
Receive ( byte buffer, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
Receive ( byte buffer, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
Receive ( byte buffer, int offset, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
ReceiveFrom ( byte buffer, EndPoint remoteEP ) : IEnumerator
ReceiveFrom ( byte buffer, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
ReceiveFrom ( byte buffer, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
ReceiveFrom ( byte buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
Send ( IList buffers, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
Send ( byte buffer, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
Send ( byte buffer, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
Send ( byte buffer, int offset, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
SendTo ( byte buffer, EndPoint remoteEP ) : IEnumerator
SendTo ( byte buffer, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
SendTo ( byte buffer, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
SendTo ( byte buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
Shutdown ( SocketShutdown how ) : void

Protected Methods

Method Description
Callback ( object socket, SocketAsyncEventArgs e ) : void
Cosocket ( ) : System
EventArgs ( ) : SocketAsyncEventArgs
Spawn ( bool>.Func sockMethod, SocketAsyncEventArgs e ) : IEnumerator
Spawn ( bool>.Func sockMethod, SocketAsyncEventArgs e, ResultGetter getResult ) : IEnumerator

Method Details

Accept() public method

public Accept ( ) : IEnumerator
return IEnumerator

Bind() public method

public Bind ( EndPoint localEP ) : void
localEP System.Net.EndPoint
return void

Callback() protected method

protected Callback ( object socket, SocketAsyncEventArgs e ) : void
socket object
e System.Net.Sockets.SocketAsyncEventArgs
return void

Close() public method

public Close ( int timeout ) : void
timeout int
return void

Connect() public method

public Connect ( EndPoint remoteEP ) : IEnumerator
remoteEP System.Net.EndPoint
return IEnumerator

Connect() public method

public Connect ( IPAddress address, int port ) : IEnumerator
address System.Net.IPAddress
port int
return IEnumerator

Cosocket() protected method

protected Cosocket ( ) : System
return System

Cosocket() public method

public Cosocket ( AddressFamily family, SocketType sockType, ProtocolType protType ) : System
family AddressFamily
sockType SocketType
protType ProtocolType
return System

Cosocket() public method

public Cosocket ( Socket socket ) : System
socket Socket
return System

Cosocket() public method

public Cosocket ( SocketInformation info ) : System
info System.Net.Sockets.SocketInformation
return System

Disconnect() public method

public Disconnect ( bool reuseSocket = false ) : IEnumerator
reuseSocket bool
return IEnumerator

EventArgs() protected method

protected EventArgs ( ) : SocketAsyncEventArgs
return SocketAsyncEventArgs

Listen() public method

public Listen ( int backlog ) : void
backlog int
return void

Receive() public method

public Receive ( IList buffers, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffers IList
socketFlags SocketFlags
return IEnumerator

Receive() public method

public Receive ( byte buffer, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffer byte
socketFlags SocketFlags
return IEnumerator

Receive() public method

public Receive ( byte buffer, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffer byte
size int
socketFlags SocketFlags
return IEnumerator

Receive() public method

public Receive ( byte buffer, int offset, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffer byte
offset int
size int
socketFlags SocketFlags
return IEnumerator

ReceiveFrom() public method

public ReceiveFrom ( byte buffer, EndPoint remoteEP ) : IEnumerator
buffer byte
remoteEP EndPoint
return IEnumerator

ReceiveFrom() public method

public ReceiveFrom ( byte buffer, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
buffer byte
socketFlags SocketFlags
remoteEP EndPoint
return IEnumerator

ReceiveFrom() public method

public ReceiveFrom ( byte buffer, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
buffer byte
size int
socketFlags SocketFlags
remoteEP EndPoint
return IEnumerator

ReceiveFrom() public method

public ReceiveFrom ( byte buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
buffer byte
offset int
size int
socketFlags SocketFlags
remoteEP EndPoint
return IEnumerator

Send() public method

public Send ( IList buffers, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffers IList
socketFlags SocketFlags
return IEnumerator

Send() public method

public Send ( byte buffer, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffer byte
socketFlags SocketFlags
return IEnumerator

Send() public method

public Send ( byte buffer, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffer byte
size int
socketFlags SocketFlags
return IEnumerator

Send() public method

public Send ( byte buffer, int offset, int size, SocketFlags socketFlags = SocketFlags.None ) : IEnumerator
buffer byte
offset int
size int
socketFlags SocketFlags
return IEnumerator

SendTo() public method

public SendTo ( byte buffer, EndPoint remoteEP ) : IEnumerator
buffer byte
remoteEP EndPoint
return IEnumerator

SendTo() public method

public SendTo ( byte buffer, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
buffer byte
socketFlags SocketFlags
remoteEP EndPoint
return IEnumerator

SendTo() public method

public SendTo ( byte buffer, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
buffer byte
size int
socketFlags SocketFlags
remoteEP EndPoint
return IEnumerator

SendTo() public method

public SendTo ( byte buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP ) : IEnumerator
buffer byte
offset int
size int
socketFlags SocketFlags
remoteEP EndPoint
return IEnumerator

Shutdown() public method

public Shutdown ( SocketShutdown how ) : void
how SocketShutdown
return void

Spawn() protected method

protected Spawn ( bool>.Func sockMethod, SocketAsyncEventArgs e ) : IEnumerator
sockMethod bool>.Func
e SocketAsyncEventArgs
return IEnumerator

Spawn() protected method

protected Spawn ( bool>.Func sockMethod, SocketAsyncEventArgs e, ResultGetter getResult ) : IEnumerator
sockMethod bool>.Func
e SocketAsyncEventArgs
getResult ResultGetter
return IEnumerator

Property Details

socket protected_oe property

protected Socket socket
return Socket

token protected_oe property

protected uint token
return uint

waiting protected_oe property

protected HashSet waiting
return HashSet