#include <cdlSocket.h>
Inheritance diagram for CCdlSocket:
Public Member Functions | |
CCdlSocket (char *adress, int port) | |
Constructs a CCdlSocket object. | |
virtual | ~CCdlSocket () |
Destructs the object. | |
virtual int | send (const void *_buf, int _size) |
Sends data to the socket. | |
virtual int | recv (void *_buf, int _size) |
Receives data from the socket. | |
virtual int | disconnect () |
Terminates the socket connection. | |
Static Protected Member Functions | |
static char | digit (const int _val) |
Converts an integer to a char. | |
Private Attributes | |
char * | _ipAddr |
IP Address of the Robot or simulation environment. | |
int | _port |
Port number of the KNI communication socket. | |
int | _len |
Length of the message. | |
int | _socketfd |
File handler for the socket. | |
sockaddr_in | _socketAddr |
Structure to fill in the socket communication parameteres. |
This class is responsible for direct communication with the Katana robot or its simulation environment through sockets. It builds the lowest layer for KNI communication and uses the system API functions to get access to the socket.
Definition at line 61 of file cdlSocket.h.
CCdlSocket::CCdlSocket | ( | char * | adress, | |
int | port | |||
) |
Constructs a CCdlSocket object.
To this constructor the socket's AF_INET address (for platform independence) and port number have to be given as parameters. An attempt to open a connection to the desired device will be tried and if successful, 'lastOP()' will return 'lopDONE', otherwise 'lopFAIL'.
virtual CCdlSocket::~CCdlSocket | ( | ) | [virtual] |
Destructs the object.
static char CCdlSocket::digit | ( | const int | _val | ) | [inline, static, protected] |
virtual int CCdlSocket::disconnect | ( | ) | [virtual] |
Terminates the socket connection.
virtual int CCdlSocket::recv | ( | void * | _buf, | |
int | _size | |||
) | [virtual] |
virtual int CCdlSocket::send | ( | const void * | _buf, | |
int | _size | |||
) | [virtual] |
char* CCdlSocket::_ipAddr [private] |
IP Address of the Robot or simulation environment.
Set to localhost or 127.0.0.1 if the simulation runs on the same machine
Definition at line 65 of file cdlSocket.h.
int CCdlSocket::_len [private] |
int CCdlSocket::_port [private] |
struct sockaddr_in CCdlSocket::_socketAddr [private] |
Structure to fill in the socket communication parameteres.
Definition at line 84 of file cdlSocket.h.
int CCdlSocket::_socketfd [private] |