

Definition at line 157 of file osaSocket.h.
| osaSocket::osaSocket | ( | void * | socketFDPtr | ) | [protected] |
osaSocketServer constructor (for use by osaSocketServer)
| Void | pointer is used to her avoid including WinSock2.h, the pointer is cast to proper socket in cpp file. |
| int osaSocket::GetIdentifier | ( | void | ) | const [inline] |
| static std::string osaSocket::GetLocalhostIP | ( | void | ) | [static] |
| static int osaSocket::GetLocalhostIP | ( | std::vector< std::string > & | IPaddress | ) | [static] |
Retrieve IP address of the localhost as string from each network interface (which may be more than two).
| IPaddresses | container for IP address as string |
| void osaSocket::SetDestination | ( | const std::string & | host, | |
| unsigned short | port | |||
| ) |
Set the destination address for UDP or TCP socket.
| host | Server's hostname or IP address (e.g. localhost, 127.0.0.1) | |
| port | Server's port number |
| bool osaSocket::Connect | ( | void | ) |
Connect to the server; required for TCP sockets and should be used after SetDestination().
| bool osaSocket::Connect | ( | const std::string & | host, | |
| unsigned short | port | |||
| ) |
Connect to the server; required for TCP sockets; includes call to SetDestination().
| host | Server's hostname or IP address (e.g. localhost, 127.0.0.1) | |
| port | Server's port number |
| int osaSocket::Send | ( | const char * | bufsend, | |
| unsigned int | msglen, | |||
| const double | timeoutSec = 0.0 | |||
| ) |
Send a byte array via the socket.
| bufsend | Buffer holding bytes to be sent | |
| msglen | Number of bytes to send | |
| timeoutSec | is the longest time we should wait to send something (NA for UDP) |
| int osaSocket::Send | ( | const std::string & | bufsend | ) | [inline] |
Send a string via the socket.
| bufsend | String to be sent |
Definition at line 232 of file osaSocket.h.
| int osaSocket::Receive | ( | char * | bufrecv, | |
| unsigned int | maxlen, | |||
| const double | timeoutSec = 0.0 | |||
| ) |
Receive a byte array via the socket.
| bufrecv | Buffer to store received data | |
| maxlen | Maximum number of bytes to receive | |
| timeoutSec | Timeout in seconds. (NA for UDP) |
| bool osaSocket::Close | ( | void | ) |
Close the socket.
| bool osaSocket::IsConnected | ( | void | ) |
\ brief Connection state (only works for TCP)
| unsigned long osaSocket::GetIP | ( | const std::string & | host | ) | const [protected] |