54 HASSERT(size ==
sizeof(
struct can_frame));
55 auto *b = port()->hub_->alloc();
56 b->data()->skipMember_ = &port()->writeFlow_;
57 memcpy(b->data()->mutable_frame(), buf, size);
58 port()->hub_->send(b, 0);
68 if (config_gridconnect_port_max_incoming_packets() < 1000000)
71 config_gridconnect_port_max_incoming_packets());
81 done = semaphores_->acquire();
83 auto *b = port()->hub_->alloc();
88 b->data()->skipMember_ = &port()->writeFlow_;
89 b->data()->assign((
const char *)buf, size);
90 port()->hub_->send(b);
100 sizeof(
kThreadPrefix) == 11,
"size of thread prefix incorrect");
116 *q =
'0' + (ff % 10);
static const char kThreadPrefix[]
Prefix for thread names created by the FdHubPort for reading and writing.
A BarrierNotifiable allows to create a number of child Notifiable and wait for all of them to finish.
static void fill_thread_name(char *buf, char mode, int fd)
Puts the desired thread name for the read or write thread.
void init()
Initializes the semaphore notifiables.
void send_message(const void *buf, int size) OVERRIDE
Sends off a buffer.
HubPort that connects a raw device to a strongly typed Hub.
A block of BarrierNotifiable objects, with a synchronous allocation call.
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.