KatanaNativeInterface $VERSION$
|
Encapsulates the socket communication device. More...
#include <cdlSocket.h>
Public Member Functions | |
CCdlSocket (char *adress, int port) | |
Constructs a CCdlSocket object. More... | |
virtual | ~CCdlSocket () |
Destructs the object. More... | |
virtual int | send (const void *_buf, int _size) |
Sends data to the socket. More... | |
virtual int | recv (void *_buf, int _size) |
Receives data from the socket. More... | |
virtual int | disconnect () |
Terminates the socket connection. More... | |
![]() | |
virtual int | send (const void *_buf, int _sz)=0 |
Pure function to send data. More... | |
virtual int | recv (void *_buf, int _sz)=0 |
Pure function to receive data. More... | |
virtual | ~CCdlBase () |
destructor More... | |
Static Protected Member Functions | |
static char | digit (const int _val) |
Converts an integer to a char. More... | |
Private Attributes | |
char * | _ipAddr |
IP Address of the Robot or simulation environment. More... | |
int | _port |
Port number of the KNI communication socket. More... | |
int | _len |
Length of the message. More... | |
int | _socketfd |
File handler for the socket. More... | |
struct sockaddr_in | _socketAddr |
Structure to fill in the socket communication parameteres. More... | |
Encapsulates the socket communication device.
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 |
Destructs the object.
|
inlinestaticprotected |
Converts an integer to a char.
Definition at line 93 of file cdlSocket.h.
|
virtual |
Terminates the socket connection.
|
virtual |
Receives data from the socket.
Implements CCdlBase.
|
virtual |
Sends data to the socket.
Implements CCdlBase.
|
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.
|
private |
Length of the message.
Definition at line 69 of file cdlSocket.h.
|
private |
Port number of the KNI communication socket.
Definition at line 67 of file cdlSocket.h.
|
private |
Structure to fill in the socket communication parameteres.
Definition at line 84 of file cdlSocket.h.
|
private |
File handler for the socket.
Definition at line 82 of file cdlSocket.h.