Send/Receive works on TcpSocket now

This commit is contained in:
Cloaked9000
2016-12-09 16:55:53 +00:00
parent 533412d3d0
commit d36a98b9b2
10 changed files with 460 additions and 215 deletions
+7
View File
@@ -46,6 +46,13 @@ inline double ntohd(double val)
memcpy(&val, &ret, sizeof(val));
return val;
}
inline void *get_sin_addr(struct sockaddr *sa)
{
if(sa->sa_family == AF_INET)
return &(((sockaddr_in*)sa)->sin_addr);
return &(((sockaddr_in6*)sa)->sin6_addr);
}
//Windows and UNIX require some different headers.
//We also need some compatibility defines for cross platform support.