45 const bool use_select =
60 DIE(
"Neither hub, nor directhub given to connection client");
void create_port_for_fd(DirectHubInterface< uint8_t[]> *hub, int fd, std::unique_ptr< MessageSegmenter > segmenter, Notifiable *on_error)
Creates a hub port of byte stream type reading/writing a given fd.
MessageSegmenter * create_gc_message_segmenter()
Creates a message segmenter for gridconnect data.
void create_gc_port_for_can_hub(CanHubFlow *can_hub, int fd, Notifiable *on_exit, bool use_select)
Creates a new port on a CAN hub in gridconnect format for a select-compatible file descriptor.
ByteDirectHubInterface * directHub_
DirectHub to read/write data to.
DeviceClosedNotify closedNotify_
Will be called when the descriptor experiences an error (typivcally upon device closed or connection ...
int fd_
File descriptor of the currently open device/socket.
void connection_complete(int fd)
Callback from try_connect to donate the file descriptor.
CanHubFlow * hub_
CAN hub to read-write data to.
#define CONSTANT_TRUE
We cannot compare constants to zero, so we use 1 and 2 as constant values for booleans.
#define DIE(MSG)
Unconditionally terminates the current process with a message.
static void optimize_fd(int fd)
For an fd that is an outgoing link, detects what kind of file descriptor this is and calls the approp...