#include <ArTcpConnection.h>
Inheritance diagram for ArTcpConnection::
Public Types | |
enum | Open { OPEN_NET_FAIL = 1, OPEN_BAD_HOST, OPEN_NO_ROUTE, OPEN_CON_REFUSED } |
Public Methods | |
ArTcpConnection (void) | |
Constructor. | |
virtual | ~ArTcpConnection (void) |
Destructor also closes connection. | |
int | open (const char *host=NULL, int port=8101) |
Opens a connection to the given host and port. More... | |
virtual bool | openSimple (void) |
Opens the connection again, using the values from setLocation or. | |
virtual int | getStatus (void) |
Gets the status of the connection, which is one of the enum status. More... | |
virtual bool | close (void) |
Closes the connection. More... | |
virtual int | read (const char *data, unsigned int size, unsigned int msWait=0) |
Reads data from connection. More... | |
virtual int | write (const char *data, unsigned int size) |
Writes data to connection. More... | |
virtual std::string | getOpenMessage (int messageNumber) |
Gets the string of the message associated with opening the device. More... | |
virtual ArTime | getTimeRead (int index) |
Gets the time data was read in. More... | |
virtual bool | isTimeStamping (void) |
sees if timestamping is really going on or not. More... | |
std::string | getHost (void) |
Gets the name of the host connected to. More... | |
int | getPort (void) |
Gets the number of the port connected to. More... | |
int | internalOpen (void) |
Internal function used by open and openSimple. | |
void | setSocket (ArSocket *socket) |
Sets the tcp connection to use this socket instead of its own. More... | |
ArSocket * | getSocket (void) |
Gets the socket this tcp connection is using. | |
void | setStatus (int status) |
Sets the status of the device, ONLY use this if you're playing with setSocket and know what you're doing. |
|
|
|
Closes the connection.
Reimplemented from ArDeviceConnection. |
|
Gets the name of the host connected to.
|
|
Gets the string of the message associated with opening the device. Each class inherited from this one has an open method which returns 0 for success or an integer which can be passed into this function to obtain a string describing the reason for failure
Reimplemented from ArDeviceConnection. |
|
Gets the number of the port connected to.
|
|
Gets the status of the connection, which is one of the enum status. Gets the status of the connection, which is one of the enum status. If you want to get a string to go along with the number, use getStatusMessage
Reimplemented from ArDeviceConnection. |
|
Gets the time data was read in.
Reimplemented from ArDeviceConnection. |
|
sees if timestamping is really going on or not.
Reimplemented from ArDeviceConnection. |
|
Opens a connection to the given host and port.
|
|
Reads data from connection. Reads data from connection
Reimplemented from ArDeviceConnection. |
|
Sets the tcp connection to use this socket instead of its own. This will make the connection use this socket, its useful for doing funkier things with sockets but still being able to use a device connection.
|
|
Writes data to connection. Writes data to connection
Reimplemented from ArDeviceConnection. |