MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ send_message()

bool Lila::Server::send_message ( int  client_fd,
std::string_view  message 
)
private

Sends a message to a client.

Parameters
client_fdClient file descriptor
messageMessage to send
Returns
True if message sent successfully

Definition at line 400 of file Server.cpp.

401{
402 std::string msg_with_newline = std::string(message) + "\n";
403#ifdef MAYAFLUX_PLATFORM_WINDOWS
404 int sent = send(static_cast<SOCKET>(client_fd), msg_with_newline.data(), static_cast<int>(msg_with_newline.size()), 0);
405 return sent == static_cast<int>(msg_with_newline.size());
406#else
407 ssize_t sent = send(client_fd, msg_with_newline.data(), msg_with_newline.size(), 0);
408 return sent == static_cast<ssize_t>(msg_with_newline.size());
409#endif
410}

Referenced by broadcast_event(), handle_client(), and process_control_message().

+ Here is the caller graph for this function: