Added new changes for the network issue

This commit is contained in:
jai.s 2019-12-07 20:07:35 +05:30
parent ded1defb1f
commit d8d57024db
No known key found for this signature in database
GPG Key ID: 360CFA25EFC67D12
4 changed files with 12 additions and 20 deletions

View File

@ -249,7 +249,7 @@ def select_poller(timeout=0.0, map=None):
rd = [] rd = []
wt = [] wt = []
ex = [] ex = []
for fd, obj in map.items(): for fd, obj in list(map.items()):
is_r = obj.readable() is_r = obj.readable()
is_w = obj.writable() is_w = obj.writable()
if is_r: if is_r:
@ -660,9 +660,6 @@ class dispatcher:
def readable(self): def readable(self):
"""Predicate to indicate download throttle status""" """Predicate to indicate download throttle status"""
print('-------------------------------------')
print('---------------asyncore--------------')
print('-------------------------------------')
if maxDownloadRate > 0: if maxDownloadRate > 0:
return downloadBucket > dispatcher.minTx return downloadBucket > dispatcher.minTx
return True return True

View File

@ -106,20 +106,16 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
count+=1 count+=1
if self.command == 'verack'.encode(): if self.command == 'verack'.encode():
addr_verack+=1 addr_verack+=1
print('the addr_verack count are -{}'.format(addr_verack)) # print('the addr_verack count are -{}'.format(addr_verack))
if self.command == 'version'.encode(): if self.command == 'version'.encode():
addr_version+=1 addr_version+=1
print('the addr_version count are -{}'.format(addr_version)) # print('the addr_version count are -{}'.format(addr_version))
if self.command == 'addr'.encode(): if self.command == 'addr'.encode():
addr_count+=1 addr_count+=1
print('the addr_count count are -{}'.format(addr_count)) # print('the addr_count count are -{}'.format(addr_count))
# print('The count of the excaution are -{}'.format(count))
# print('-----------count---------------{}'.format(count))
# print('------self command-----------{}'.format(self.command))
# print('----------self---------------{}'.format(self))
if self.magic != 0xE9BEB4D9: if self.magic != 0xE9BEB4D9:
# skip 1 byte in order to sync # skip 1 byte in order to sync
#in the advancedispatched and length commend's #in the advancedispatched and length commend's
@ -569,17 +565,17 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
logger.debug( logger.debug(
'%(host)s:%(port)i sending version', '%(host)s:%(port)i sending version',
self.destination._asdict()) self.destination._asdict())
if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL) and if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL)):
protocol.haveSSL(not self.isOutbound)): # self.isSSL = True
self.isSSL = True pass
if not self.verackReceived: if not self.verackReceived:
return True return True
# print('inside the bmproto line') # self.set_state(
# print('before the value of state are :-{}'.format(self.state)) # "tls_init" if self.isSSL else "connection_fully_established",
# length=self.payloadLength, expectBytes=0)
self.set_state( self.set_state(
"tls_init" if self.isSSL else "connection_fully_established", "connection_fully_established",
length=self.payloadLength, expectBytes=0) length=self.payloadLength, expectBytes=0)
# print('After the value of state are :-{}'.format(self.state))
return False return False
def peerValidityChecks(self): # pylint: disable=too-many-return-statements def peerValidityChecks(self): # pylint: disable=too-many-return-statements

View File

@ -32,7 +32,7 @@ def connectedHostsList():
retval.append(i) retval.append(i)
except AttributeError: except AttributeError:
pass pass
# print('#################### retval -{}'.format(retval))
return retval return retval

View File

@ -84,7 +84,6 @@ class TLSDispatcher(AdvancedDispatcher): # pylint: disable=too-many-instanc
# also exclude TLSv1 and TLSv1.1 in the future # also exclude TLSv1 and TLSv1.1 in the future
context.options = ssl.OP_ALL | ssl.OP_NO_SSLv2 |\ context.options = ssl.OP_ALL | ssl.OP_NO_SSLv2 |\
ssl.OP_NO_SSLv3 | ssl.OP_SINGLE_ECDH_USE | ssl.OP_CIPHER_SERVER_PREFERENCE ssl.OP_NO_SSLv3 | ssl.OP_SINGLE_ECDH_USE | ssl.OP_CIPHER_SERVER_PREFERENCE
self.sslSocket = context.wrap_socket( self.sslSocket = context.wrap_socket(
self.socket, server_side=self.server_side, do_handshake_on_connect=False) self.socket, server_side=self.server_side, do_handshake_on_connect=False)
else: else: