fix client to fail on SSL error
This commit is contained in:
parent
f1b30a5c51
commit
d01323432f
@ -131,6 +131,7 @@ class MyConnection(fusion.ConnectionEventHandler):
|
|||||||
|
|
||||||
def connection_failed(self, connection, error):
|
def connection_failed(self, connection, error):
|
||||||
LOG.error("Connection failed! error=%s" % str(error))
|
LOG.error("Connection failed! error=%s" % str(error))
|
||||||
|
raise Exception("Connection failure: %s" % str(error))
|
||||||
|
|
||||||
def sender_requested(self, connection, link_handle,
|
def sender_requested(self, connection, link_handle,
|
||||||
requested_source, properties={}):
|
requested_source, properties={}):
|
||||||
@ -357,36 +358,39 @@ def main(argv=None):
|
|||||||
"my-target-address",
|
"my-target-address",
|
||||||
receiver_properties={},
|
receiver_properties={},
|
||||||
sender_properties={})
|
sender_properties={})
|
||||||
my_connection.connect(my_socket)
|
try:
|
||||||
|
my_connection.connect(my_socket)
|
||||||
|
repeat = 0
|
||||||
|
while opts.repeat == 0 or repeat < opts.repeat:
|
||||||
|
|
||||||
repeat = 0
|
LOG.debug("Requesting RPC...")
|
||||||
while opts.repeat == 0 or repeat < opts.repeat:
|
|
||||||
|
|
||||||
LOG.debug("Requesting RPC...")
|
my_caller.connect()
|
||||||
|
while not my_caller.done():
|
||||||
|
my_connection.process()
|
||||||
|
|
||||||
my_caller.connect()
|
LOG.debug("RPC completed! Closing caller...")
|
||||||
while not my_caller.done():
|
|
||||||
|
my_caller.close()
|
||||||
|
|
||||||
|
while not my_caller.closed():
|
||||||
|
my_connection.process()
|
||||||
|
|
||||||
|
LOG.debug("Caller closed cleanly!")
|
||||||
|
|
||||||
|
repeat += 1
|
||||||
|
|
||||||
|
print("Closing connections")
|
||||||
|
my_connection.close()
|
||||||
|
while not my_connection.closed:
|
||||||
my_connection.process()
|
my_connection.process()
|
||||||
|
|
||||||
LOG.debug("RPC completed! Closing caller...")
|
LOG.debug("Connection closed")
|
||||||
|
my_caller.destroy()
|
||||||
my_caller.close()
|
my_connection.destroy()
|
||||||
|
except Exception as e:
|
||||||
while not my_caller.closed():
|
LOG.error("Unexpected exception occured: %s" % str(e))
|
||||||
my_connection.process()
|
return -1
|
||||||
|
|
||||||
LOG.debug("Caller closed cleanly!")
|
|
||||||
|
|
||||||
repeat += 1
|
|
||||||
|
|
||||||
print("Closing connections")
|
|
||||||
my_connection.close()
|
|
||||||
while not my_connection.closed:
|
|
||||||
my_connection.process()
|
|
||||||
|
|
||||||
LOG.debug("Connection closed")
|
|
||||||
my_caller.destroy()
|
|
||||||
my_connection.destroy()
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user