Aria: ArTcpConnection Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArTcpConnection Class Reference

`#include <ArTcpConnection.h>`

Inheritance diagram for ArTcpConnection:

List of all members.

## Detailed Description

For connectiong to a device through a socket.

## Public Types
enum | Open { OPEN_NET_FAIL = 1, OPEN_BAD_HOST, OPEN_NO_ROUTE, OPEN_CON_REFUSED }
## Public Member Functions
| ArTcpConnection ()
| Constructor.
virtual bool | close (void)
std::string | getHost (void)
| Gets the name of the host connected to.
virtual const char * | getOpenMessage (int messageNumber)
int | getPort (void)
| Gets the number of the port connected to.
ArSocket * | getSocket (void)
| Gets the socket this tcp connection is using.
virtual int | getStatus (void)
virtual ArTime | getTimeRead (int index)
int | internalOpen (void)
| Internal function used by open and openSimple.
virtual bool | isTimeStamping (void)
int | open (const char *host=NULL, int port=8101)
| Opens a connection to the given host and port.
virtual bool | openSimple (void)
virtual int | read (const char *data, unsigned int size, unsigned int msWait=0)
void | setPort (const char *host=NULL, int port=8101)
void | setSocket (ArSocket *socket)
| Sets the tcp connection to use this socket instead of its own.
void | setStatus (int status)
virtual int | write (const char *data, unsigned int size)
virtual | ~ArTcpConnection ()
| Destructor also closes connection.
## Protected Member Functions
void | buildStrMap (void)
## Protected Attributes
std::string | myHostName
bool | myOwnSocket
int | myPortNum
ArSocket * | mySocket
int | myStatus
ArStrMap | myStrMap

## Member Enumeration Documentation

enum ArTcpConnection::Open

Enumerator:

  OPEN_NET_FAIL | Some critical part of the network isn't working.
  OPEN_BAD_HOST | Could not find the host.
  OPEN_NO_ROUTE | Know where the host is, but can't get to it.
  OPEN_CON_REFUSED | Got to the host but it didn't allow a connection.

## Member Function Documentation

void ArTcpConnection::setStatus | ( | int | status | ) |

Sets the status of the device, ONLY use this if you're playing with setSocket and know what you're doing

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

- ArTcpConnection.h