Socket udp server.
More...
Socket udp server.
- See also
- SocketUdp
|
bool | TryOpen (Int32 port, String &errorMessage, bool ReuseAddress=false) |
| Try to open the socket. More...
|
|
void | Open (Int32 port, bool ReuseAddress=false) |
| Opens. More...
|
|
bool | Receive (PeerInfo &peerInfo, void *data, Int32 bufferSize, Int32 &dataSize, TimeSpan timeOut=TimeInfinite) |
| Receives. More...
|
|
void | Send (PeerInfo &peerInfo, const void *data, Int32 dataSize) |
| Send this message. More...
|
|
| Socket () |
| Default constructor. More...
|
|
virtual | ~Socket () |
| Destructor. More...
|
|
void | Close () |
| Closes this object. More...
|
|
bool | IsOpen () const |
| Query if the socket is open. More...
|
|
PCChar8 | GetHostName () const |
| Gets the host name. More...
|
|
Int32 | GetPort () const |
| Gets the port. More...
|
|
const PeerInfo & | GetPeerInfo () const |
| Gets the peer information. More...
|
|
void | SetOption (SocketOption option, bool value) |
| Sets an option. More...
|
|
void Open |
( |
Int32 |
port, |
|
|
bool |
ReuseAddress = false |
|
) |
| |
Opens.
- Parameters
-
port | The port. |
ReuseAddress | (optional) Allows the socket to be bound to a port that is already in use. Default = false. |
Will raise an exception if failed. See TryOpen.
Receives.
- Parameters
-
peerInfo | [in,out] Information describing the sending peer. |
data | [in,out] The receive data buffer. |
bufferSize | Size of the receive data buffer. |
dataSize | [in,out] Size of the received data. |
timeOut | (optional) the time out. Default = Infinite. |
- Returns
- true if data received, false if timeout occurs.
void Send |
( |
PeerInfo & |
peerInfo, |
|
|
const void * |
data, |
|
|
Int32 |
dataSize |
|
) |
| |
Send this message.
- Parameters
-
peerInfo | [in,out] Information describing the destination peer. |
data | The data buffer to send. |
dataSize | Size of the data to send. |
bool TryOpen |
( |
Int32 |
port, |
|
|
String & |
errorMessage, |
|
|
bool |
ReuseAddress = false |
|
) |
| |
Try to open the socket.
- Parameters
-
port | The port. |
errorMessage | [in,out] Message describing the error. |
ReuseAddress | (optional) Allows the socket to be bound to a port that is already in use. Default = false. |
- Returns
- true if it succeeds, false if it fails.