API Guides > ConceptRT 3.x
SocketTcp Class Reference

Socket tcp. More...

Detailed Description

Socket tcp.

+ Inheritance diagram for SocketTcp:

Public Member Methods

bool Receive (void *data, Int32 bufferSize, Int32 &dataSize, TimeSpan timeOut=TimeInfinite)
 Receives data. More...
 
bool Send (const void *data, Int32 dataSize, Int32 &dataSent)
 Send data. More...
 
bool ReceiveBuffer (void *data, Int32 dataSize, TimeSpan timeOut=TimeInfinite)
 Receive a buffer. More...
 
bool SendBuffer (const void *data, Int32 dataSize)
 Sends a buffer. 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...
 

Methods Documentation

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

Receives data.

Parameters
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.
bool ReceiveBuffer ( void *  data,
Int32  dataSize,
TimeSpan  timeOut = TimeInfinite 
)

Receive a buffer.

Parameters
data[in,out] The receive data buffer.
dataSizeSize of the data to receive.
timeOut(optional) the time out. Default = Infinite.
Returns
true if the expected buffer size is received, false if it timeout occurs.
bool Send ( const void *  data,
Int32  dataSize,
Int32 dataSent 
)

Send data.

Parameters
dataThe data buffer to send.
dataSizeSize of the data to send.
dataSent[in,out] The size of data sent.
Returns
true if it succeeds, false if it fails. Return false when disconnected.
bool SendBuffer ( const void *  data,
Int32  dataSize 
)

Sends a buffer.

Parameters
dataThe data buffer to send.
dataSizeSize of the data to send.
Returns
true if the whole buffer is sent, false if it fails. Return false when disconnected.