#include <socketTCP.h>
Public Member Functions | |
int | getInt (int &n) |
int | getDouble (Decimal &d) |
int | sendInt (int n) |
int | sendDouble (Decimal d) |
int | sendMessage (char *buf, int size) |
int | getMessage (char *buf, int size) |
int | waitMessage (char *msg) |
SocketTCP () | |
default constructor | |
void | setBufSize (int a) |
void | ack () |
send ACK | |
void | ok () |
send ok | |
void | waitAck () |
wait for ACK | |
void | waitOk () |
wait for ok | |
int | checkMessagePresence (void) |
check if incoming messages are present | |
void | closeConnection () |
Public Attributes | |
int | m_port |
port on which the messages are send | |
int | m_ds_sock_client |
struct sockaddr_in | my_addr |
my address | |
char | m_buffer [TCP_MSG_SIZE+1] |
buffer for small size messages (fixed size is TCP_MSG_SIZE+1) | |
char * | buffer |
buffer of variable size for big size messages | |
int | bufsize |
size of buffer |
SocketTCP::SocketTCP | ( | ) |
default constructor
int SocketTCP::getInt | ( | int & | n | ) |
int SocketTCP::getDouble | ( | Decimal & | d | ) |
int SocketTCP::sendInt | ( | int | n | ) |
int SocketTCP::sendDouble | ( | Decimal | d | ) |
int SocketTCP::sendMessage | ( | char * | buf, | |
int | size | |||
) |
send a message
buf | pointer to the message | |
size | size of the message |
int SocketTCP::getMessage | ( | char * | buf, | |
int | size | |||
) |
get a message
buf | pointer to the message | |
size | size of the message |
int SocketTCP::waitMessage | ( | char * | msg | ) |
wait untill a selected message is received
msg | message to be received |
void SocketTCP::setBufSize | ( | int | a | ) | [inline] |
set buffer size
a | size to which set the buffer size |
void SocketTCP::ack | ( | ) | [inline] |
send ACK
void SocketTCP::ok | ( | ) | [inline] |
send ok
void SocketTCP::waitAck | ( | ) | [inline] |
wait for ACK
void SocketTCP::waitOk | ( | ) | [inline] |
wait for ok
int SocketTCP::checkMessagePresence | ( | void | ) |
check if incoming messages are present
void SocketTCP::closeConnection | ( | ) |
struct sockaddr_in SocketTCP::my_addr [read] |
my address
char SocketTCP::m_buffer[TCP_MSG_SIZE+1] |
buffer for small size messages (fixed size is TCP_MSG_SIZE+1)
char* SocketTCP::buffer |
buffer of variable size for big size messages
size of buffer