C# Class MiniUDP.NetSocket

Since raw sockets are thread safe, we use a global socket singleton between the two threads for the sake of convenience.
ファイルを表示 Open project: ashoulson/MiniUDP Class Usage Examples

Public Methods

Method Description
Empty ( SocketError error ) : bool
Succeeded ( SocketError error ) : bool

Private Methods

Method Description
Bind ( int port ) : SocketError
Close ( ) : void
NetSocket ( ) : System.Net
TryReceive ( IPEndPoint &source, byte destBuffer, int &length ) : SocketError

Attempts to read from OS socket. Returns false if the read fails or if there is nothing to read.

TrySend ( IPEndPoint destination, byte buffer, int length ) : SocketError

Attempts to send data to endpoint via OS socket. Returns false if the send failed.

Method Details

Empty() public static method

public static Empty ( SocketError error ) : bool
error SocketError
return bool

Succeeded() public static method

public static Succeeded ( SocketError error ) : bool
error SocketError
return bool