summaryrefslogtreecommitdiffstats
path: root/module/remote
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-11-12 22:54:29 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-11-12 22:54:29 +0100
commitb7dff98c2e76b28422d40076273753b4216a819a (patch)
treee2a24cdde775792624f30b7c24624c7c57068209 /module/remote
parentshareonline.biz premium (diff)
downloadpyload-b7dff98c2e76b28422d40076273753b4216a819a.tar.xz
better exception handling for sockets
Diffstat (limited to 'module/remote')
-rw-r--r--module/remote/SocketServer.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/module/remote/SocketServer.py b/module/remote/SocketServer.py
index d2fa912dd..2edd1d9f3 100644
--- a/module/remote/SocketServer.py
+++ b/module/remote/SocketServer.py
@@ -46,9 +46,12 @@ class MainServerSocket(asyncore.dispatcher):
asyncore.dispatcher.__init__(self)
pycore.logger.info('initing Remote-Server')
self.pycore = pycore
- self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
- self.bind(('', port))
- self.listen(5)
+ try:
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.bind(('', port))
+ self.listen(5)
+ except:
+ raise Exception("Can't create socket")
def handle_accept(self):
newSocket, address = self.accept()
self.pycore.logger.info("Connected from " + str(address))