Commit 7ed7ceb5 authored by Antoine Millet's avatar Antoine Millet
Browse files

Added logging to simple client.

parent 3e96452f
......@@ -4,6 +4,7 @@
import ssl
import select
import socket
import logging
from sjrpc.core import RpcConnection, ConnectionManager
class SimpleRpcClient(ConnectionManager):
......@@ -82,6 +83,8 @@ class SimpleRpcClient(ConnectionManager):
try:
self._connection.receive()
except socket.error as err:
logging.error('Socket error while receiving from the client '
'fd/%s: %s' % (fd, err))
self.shutdown()
if event & select.EPOLLOUT:
......@@ -89,9 +92,12 @@ class SimpleRpcClient(ConnectionManager):
try:
self._connection.send()
except socket.error as err:
logging.error('Socket error while sending to the client '
'fd/%s: %s' % (fd, err))
self.shutdown()
if event & select.EPOLLHUP:
logging.error('Socket HUP fd/%s: %s' % (fd, err))
self.shutdown() #TODO
def all_connections(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment