#include <socket.h>
|
static const int | lengthLen = 4 |
| Length of the message length part of a TraCI message. More...
|
|
Definition at line 60 of file socket.h.
◆ Socket() [1/2]
tcpip::Socket::Socket |
( |
std::string |
host, |
|
|
int |
port |
|
) |
| |
Constructor that prepare to connect to host:port.
Definition at line 79 of file socket.cpp.
◆ Socket() [2/2]
tcpip::Socket::Socket |
( |
int |
port | ) |
|
Constructor that prepare for accepting a connection on given port.
Definition at line 92 of file socket.cpp.
◆ ~Socket()
tcpip::Socket::~Socket |
( |
| ) |
|
◆ accept()
Socket * tcpip::Socket::accept |
( |
const bool |
create = false | ) |
|
◆ atoaddr()
bool tcpip::Socket::atoaddr |
( |
std::string |
address, |
|
|
struct sockaddr_in & |
addr |
|
) |
| |
|
private |
◆ BailOnSocketError()
void tcpip::Socket::BailOnSocketError |
( |
std::string |
context | ) |
|
|
staticprivate |
◆ close()
void tcpip::Socket::close |
( |
| ) |
|
◆ connect()
void tcpip::Socket::connect |
( |
| ) |
|
◆ datawaiting()
bool tcpip::Socket::datawaiting |
( |
int |
sock | ) |
const |
|
private |
◆ getFreeSocketPort()
int tcpip::Socket::getFreeSocketPort |
( |
| ) |
|
|
static |
Returns an free port on the system.
- Note
- This is done by binding a socket with port=0, getting the assigned port, and closing the socket again
Definition at line 124 of file socket.cpp.
◆ has_client_connection()
bool tcpip::Socket::has_client_connection |
( |
| ) |
const |
◆ init()
void tcpip::Socket::init |
( |
| ) |
|
|
private |
◆ is_blocking()
bool tcpip::Socket::is_blocking |
( |
| ) |
|
◆ port()
int tcpip::Socket::port |
( |
| ) |
|
◆ printBufferOnVerbose()
void tcpip::Socket::printBufferOnVerbose |
( |
const std::vector< unsigned char > |
buffer, |
|
|
const std::string & |
label |
|
) |
| const |
|
protected |
◆ receive()
std::vector< unsigned char > tcpip::Socket::receive |
( |
int |
bufSize = 2048 | ) |
|
◆ receiveComplete()
void tcpip::Socket::receiveComplete |
( |
unsigned char *const |
buffer, |
|
|
std::size_t |
len |
|
) |
| const |
|
protected |
◆ receiveExact()
bool tcpip::Socket::receiveExact |
( |
Storage & |
msg | ) |
|
◆ recvAndCheck()
size_t tcpip::Socket::recvAndCheck |
( |
unsigned char *const |
buffer, |
|
|
std::size_t |
len |
|
) |
| const |
|
protected |
◆ send()
void tcpip::Socket::send |
( |
const std::vector< unsigned char > & |
buffer | ) |
|
◆ sendExact()
void tcpip::Socket::sendExact |
( |
const Storage & |
b | ) |
|
Definition at line 436 of file socket.cpp.
Referenced by TraCITestClient::commandGetVariable(), TraCITestClient::commandSetValue(), TraCIAPI::load(), TraCIAPI::processGet(), TraCIAPI::processSet(), TraCIAPI::send_commandClose(), TraCIAPI::send_commandSetOrder(), TraCIAPI::send_commandSimulationStep(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), and TraCIAPI::setOrder().
◆ set_blocking()
void tcpip::Socket::set_blocking |
( |
bool |
blocking | ) |
|
◆ set_verbose()
void tcpip::Socket::set_verbose |
( |
bool |
newVerbose | ) |
|
|
inline |
◆ verbose()
bool tcpip::Socket::verbose |
( |
| ) |
|
|
inline |
◆ Response
◆ blocking_
bool tcpip::Socket::blocking_ |
|
private |
◆ host_
std::string tcpip::Socket::host_ |
|
private |
◆ lengthLen
const int tcpip::Socket::lengthLen = 4 |
|
staticprotected |
Length of the message length part of a TraCI message.
Definition at line 101 of file socket.h.
◆ port_
◆ server_socket_
int tcpip::Socket::server_socket_ |
|
private |
◆ socket_
int tcpip::Socket::socket_ |
|
private |
◆ verbose_
bool tcpip::Socket::verbose_ |
|
private |
The documentation for this class was generated from the following files: