v0.4.2 #625

Merged
Atheros1 merged 4 commits from master into master 2014-01-21 08:15:25 +01:00
2 changed files with 18 additions and 3 deletions
Showing only changes of commit c98ca590a8 - Show all commits

View File

@ -15,7 +15,8 @@ import singleton
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer
from api import MySimpleXMLRPCRequestHandler
from api import MySimpleXMLRPCRequestHandler
from helper_startup import isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections
import shared
from helper_sql import sqlQuery
@ -59,10 +60,12 @@ def connectToStream(streamNumber):
for row in queryData:
shared.inventorySets[streamNumber].add(row[0])
if sys.platform[0:3] == 'win':
if isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections():
# Some XP and Vista systems can only have 10 outgoing connections at a time.
maximumNumberOfHalfOpenConnections = 9
else:
maximumNumberOfHalfOpenConnections = 32
maximumNumberOfHalfOpenConnections = 64
for i in range(maximumNumberOfHalfOpenConnections):
a = outgoingSynSender()
a.setup(streamNumber, selfInitiatedConnections)

View File

@ -5,6 +5,8 @@ import os
import locale
import random
import string
import platform
from distutils.version import StrictVersion
from namecoin import ensureNamecoinOptions
@ -119,3 +121,13 @@ def loadConfig():
os.umask(0o077)
with open(shared.appdata + 'keys.dat', 'wb') as configfile:
shared.config.write(configfile)
def isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections():
try:
VER_THIS=StrictVersion(platform.version())
if sys.platform[0:3]=="win":
return StrictVersion("5.1.2600")<VER_THIS and StrictVersion("6.0.6000")>VER_THIS
return False
except Exception as err:
print 'An Exception occurred within isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections:', err
return False