aboutsummaryrefslogtreecommitdiff
path: root/net.cpp
diff options
context:
space:
mode:
authorWitchspace <witchspace81@gmail.com>2010-12-22 14:08:00 +0100
committerWitchspace <witchspace81@gmail.com>2010-12-22 14:08:00 +0100
commit5f88e8887a31db68493334fc8e5652c5dd9cbf89 (patch)
treecc723c7d3424b54e06a7f50d96cd7af417e97d65 /net.cpp
parent2d96276e243c93add0b0d292ae9f05a54508b6e7 (diff)
add -nolisten command line option
Diffstat (limited to 'net.cpp')
-rw-r--r--net.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/net.cpp b/net.cpp
index da7661962e..a626acd376 100644
--- a/net.cpp
+++ b/net.cpp
@@ -643,7 +643,9 @@ void ThreadSocketHandler2(void* parg)
FD_ZERO(&fdsetSend);
FD_ZERO(&fdsetError);
SOCKET hSocketMax = 0;
- FD_SET(hListenSocket, &fdsetRecv);
+
+ if(hListenSocket != INVALID_SOCKET)
+ FD_SET(hListenSocket, &fdsetRecv);
hSocketMax = max(hSocketMax, hListenSocket);
CRITICAL_BLOCK(cs_vNodes)
{
@@ -680,7 +682,7 @@ void ThreadSocketHandler2(void* parg)
//
// Accept new connections
//
- if (FD_ISSET(hListenSocket, &fdsetRecv))
+ if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv))
{
struct sockaddr_in sockaddr;
socklen_t len = sizeof(sockaddr);
@@ -1344,7 +1346,7 @@ void StartNode(void* parg)
#endif
printf("addrLocalHost = %s\n", addrLocalHost.ToString().c_str());
- if (fUseProxy || mapArgs.count("-connect"))
+ if (fUseProxy || mapArgs.count("-connect") || fNoListen)
{
// Proxies can't take incoming connections
addrLocalHost.ip = CAddress("0.0.0.0").ip;