[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/server network.cpp
From: |
Vitaly Alexeev |
Subject: |
[Gnash-commit] gnash/server network.cpp |
Date: |
Thu, 01 Jun 2006 07:23:14 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch:
Changes by: Vitaly Alexeev <address@hidden> 06/06/01 07:23:13
Modified files:
server : network.cpp
Log message:
porting to WIN32
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/network.cpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
Patches:
Index: gnash/server/network.cpp
diff -u gnash/server/network.cpp:1.10 gnash/server/network.cpp:1.11
--- gnash/server/network.cpp:1.10 Sat May 20 23:49:33 2006
+++ gnash/server/network.cpp Thu Jun 1 07:23:13 2006
@@ -53,6 +53,7 @@
# include <fcntl.h>
# include <sys/stat.h>
# include <io.h>
+# include <errno.h>
#else
# include <sys/time.h>
# include <sys/fcntl.h>
@@ -83,15 +84,29 @@
#ifndef INADDR_NONE
#define INADDR_NONE 0xffffffff
#endif
-
+
Network::Network() : _ipaddr(INADDR_ANY), _sockfd(0), _listenfd(0), _port(0),
_connected(false), _debug(false)
{
//log_msg("%s: \n", __PRETTY_FUNCTION__);
+#ifdef HAVE_WINSOCK_H
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ wVersionRequested = MAKEWORD(1, 1); // Windows
Sockets 1.1
+ if (WSAStartup( wVersionRequested, &wsaData ) != 0)
+ {
+ printf("ERROR: could not find a usable WinSock DLL.\n");
+ exit(1);
+ }
+#endif
+
}
Network::~Network()
{
//log_msg("%s: \n", __PRETTY_FUNCTION__);
+#ifdef HAVE_WINSOCK_H
+ WSACleanup();
+#endif
}
// Description: Create a tcp/ip network server. This creates a server
@@ -116,7 +131,7 @@
const struct hostent *host;
struct in_addr *thisaddr;
in_addr_t nodeaddr;
-
+
host = gethostbyname("localhost");
thisaddr = reinterpret_cast<struct in_addr *>(host->h_addr_list[0]);
_ipaddr = thisaddr->s_addr;
@@ -522,7 +537,10 @@
_debug = val;
// Turn on debugging for the utility methods
- toggleDebug(true);
+ // Vitaly: recursive on all control paths,
+ // function will cause runtime stack overflow
+
+ // toggleDebug(true);
}
#ifdef ENABLE_TESTING
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash/server network.cpp,
Vitaly Alexeev <=