This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float rawBytesToFloat(const char* _buffer) | |
{ | |
static_assert(sizeof(u_long_type) == sizeof(float),"sizes must match!"); | |
u_long_type net_int; | |
memcpy(&net_int, _buffer, sizeof(net_int)); | |
u_long_type host_int = asio::detail::socket_ops::network_to_host_long(net_int); | |
float result; | |
memcpy(&result, &host_int, sizeof(result)); | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <dispatch/dispatch.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/event.h> | |
#include <sys/event.h> | |
#include <sys/select.h> |