Skip to main content

Module tcp

Module tcp 

Source
Expand description

TCP command channel: framing plus command-id demultiplexing.

Port of Network::tcpSendRequest, Network::tcpReadFromBuffer, Network::tcpReceiveResponse, Network::tcpBlockingReceiveResponse, Network::isTcpSocketAlive and Network::tcpThrowIfConnectionClosed from libfranka 0.21.2 (src/network.h, src/network.cpp).

The FCI server answers commands out of order — a Move reply can arrive long after a StopMove sent later — so every reply is stored under the command_id of its request until the thread that issued that request picks it up. This is exactly libfranka’s received_responses_ map.

Structs§

TcpSession
A connected FCI command socket.

Constants§

DEFAULT_CONNECT_TIMEOUT
Default TCP connect/read timeout (libfranka’s Network default tcp_timeout).
POLL_TIMEOUT
Poll/read granularity of TcpSession::blocking_receive_response (libfranka’s franka::kTimeout).