Hazelcast C++ Client
Public Member Functions | List of all members
hazelcast::client::Socket Class Referenceabstract

Sockets wrapper interface class. More...

#include <Socket.h>

+ Inheritance diagram for hazelcast::client::Socket:

Public Member Functions

virtual ~Socket ()
 Destructor.
 
virtual int connect (int timeoutInMillis)=0
 connects to given address in constructor. More...
 
virtual int send (const void *buffer, int len, int flag=0)=0
 
virtual int receive (void *buffer, int len, int flag=0)=0
 
virtual int getSocketId () const =0
 return socketId
 
virtual void close ()=0
 closes the socket. More...
 
virtual client::Address getAddress () const =0
 
virtual void setBlocking (bool blocking)=0
 
virtual std::auto_ptr< AddresslocalSocketAddress () const =0
 This function is used to obtain the locally bound endpoint of the socket. More...
 

Detailed Description

Sockets wrapper interface class.

Member Function Documentation

◆ close()

virtual void hazelcast::client::Socket::close ( )
pure virtual

closes the socket.

Automatically called in destructor. Second call to this function is no op.

Implemented in hazelcast::client::internal::socket::TcpSocket.

◆ connect()

virtual int hazelcast::client::Socket::connect ( int  timeoutInMillis)
pure virtual

connects to given address in constructor.

Parameters
timeoutInMillisif not connected within timeout, it will return errorCode
Returns
0 on success.
Exceptions
IOExceptionon failure.

Implemented in hazelcast::client::internal::socket::TcpSocket.

◆ localSocketAddress()

virtual std::auto_ptr<Address> hazelcast::client::Socket::localSocketAddress ( ) const
pure virtual

This function is used to obtain the locally bound endpoint of the socket.

Returns
An address that represents the local endpoint of the socket.

Implemented in hazelcast::client::internal::socket::TcpSocket.

◆ receive()

virtual int hazelcast::client::Socket::receive ( void *  buffer,
int  len,
int  flag = 0 
)
pure virtual
Parameters
buffer
lenlength of the buffer to be received.
flagbsd sockets options flag. Only MSG_WAITALL is supported when SSL is enabled.
Returns
number of bytes received.
Exceptions
IOExceptionin failure.

Implemented in hazelcast::client::internal::socket::TcpSocket.

◆ send()

virtual int hazelcast::client::Socket::send ( const void *  buffer,
int  len,
int  flag = 0 
)
pure virtual
Parameters
buffer
lenlength of the buffer
flagbsd sockets options flag. Only MSG_WAITALL is supported when SSL is enabled.
Returns
number of bytes send
Exceptions
IOExceptionin failure.

Implemented in hazelcast::client::internal::socket::TcpSocket.


The documentation for this class was generated from the following files: