|
|
|
@ -96,13 +96,15 @@ TCP::TCP(string h, string p) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* puts the tcp server to listen mode. This code works on linux with IPV4 and IPV6
|
|
|
|
|
*/
|
|
|
|
|
int TCP::Listen(int port) {
|
|
|
|
|
char buffer[NET_BUFFERSIZE];
|
|
|
|
|
int err, i;
|
|
|
|
|
struct addrinfo hints, *res, *rp;
|
|
|
|
|
|
|
|
|
|
if (sock > 0) Close();
|
|
|
|
|
// FIXME: solution to get both (IPV4 and IPV6) to work at the same time?
|
|
|
|
|
bzero (&hints, sizeof (struct addrinfo));
|
|
|
|
|
hints.ai_flags = AI_PASSIVE;
|
|
|
|
|
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
|
|
|
|
|