MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Send

Method Send

LibLemon/src/ipc/interfaceuds.cpp:237–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 }
236
237 void MessageServer::Send(LemonMessage* msg, int fd){
238 if(fd < 0) {
239 printf("Invalid fd: %i\n", fd);
240 return;
241 }
242
243 msg->magic = LEMON_MESSAGE_MAGIC;
244
245 ssize_t sent = send(fd, msg, msg->length + sizeof(LemonMessage), MSG_DONTWAIT);
246
247 if(sent <= 0){
248 perror("Warning: Send: ");
249 } else if(sent < msg->length + static_cast<short>(sizeof(LemonMessage))){
250 printf("Warning: Tried to send %lu bytes, but only sent %ld bytes", msg->length + sizeof(LemonMessage), sent);
251 }
252 }
253
254 void MessageServer::Send(const Message& msg, int fd){
255 if(fd < 0) {

Callers

nothing calls this directly

Calls 2

dataMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected