API Guides > ConceptRT 3.x
SocketUdpServer Class Reference

Socket udp server. More...

Detailed Description

Socket udp server.

See also
SocketUdp
+ Inheritance diagram for SocketUdpServer:

Public Member Methods

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...
 
- Public Member Methods inherited from Socket
 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 PeerInfoGetPeerInfo () const
 Gets the peer information. More...
 
void SetOption (SocketOption option, bool value)
 Sets an option. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SocketUdp
bool Receive (PeerInfo &peerInfo, void *data, Int32 bufferSize, Int32 &dataSize, TimeSpan timeOut)
 Receives data. More...
 
void Send (PeerInfo &peerInfo, const void *data, Int32 dataSize)
 Send data. More...
 

Methods Documentation

void Open ( Int32  port,
bool  ReuseAddress = false 
)

Opens.

Parameters
portThe 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.

bool Receive ( PeerInfo peerInfo,
void *  data,
Int32  bufferSize,
Int32 dataSize,
TimeSpan  timeOut = TimeInfinite 
)

Receives.

Parameters
peerInfo[in,out] Information describing the sending peer.
data[in,out] The receive data buffer.
bufferSizeSize 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.
dataThe data buffer to send.
dataSizeSize of the data to send.
bool TryOpen ( Int32  port,
String errorMessage,
bool  ReuseAddress = false 
)

Try to open the socket.

Parameters
portThe 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.