Errno 49 Socket Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or errno socket error errno 11004 getaddrinfo failed posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss errno socket error python Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Socket Error Errno 10054
takes a minute: Sign up Python. I get “socket.error: [Errno 49] Can't assign requested address” after opening and closing many sockets on client side? up vote 0 down vote favorite Client side code: for currentFile in files: s = socket(AF_INET,
Socket Error Errno 10053
SOCK_STREAM) s.connect((host, port)) f = open(currentFile, 'rb') b = f.read() while b: s.send(b) b = f.read() s.close() f.close() Server side code: serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) serverSocket.listen(1) while True: (clientsocket, address) = serverSocket.accept() b = clientsocket.recv(4096) f = open('filename', 'wb') while b: f.write(b) b = clientsocket.recv(4096) f.close() My actual server side code has a bit more to it, but it has nothing to do with the networking part (Generating filename for each new file etc) When I send a socket error errno 10061 lot of files over a relatively short amount of time, I this error socket.error: [Errno 49] Can't assign requested address I modified my code with a try except block: notFoundSocket = 1 while notFoundSocket: try: s.connect((host, port)) notFoundSocket=0 except: print "Error" In which case it prints out "Error" for a while, and then it continues on sending the files. So it seems to me that the port I establish between my client and server is not released immediately, and I have to wait a while after I close it until I can use it again. Could this be correct? And if so, how do I fix it? python sockets networking share|improve this question asked Jul 23 at 2:54 Slason 33 It looks like you ran out of available ports. Is "a lot of files". How many sockets did you actually open? –Klaus D. Jul 23 at 3:20 I'm trying to send about 91 000 files, and I'm getting the error after I've sent about 30% of the total size of all the files –Slason Jul 23 at 3:25 At this point I guess you have 28,000 sockets in closing state still in the OS. It has a limit on the number of sockets. The sockets will clean up after a while. For testing: count the iteration and add a sleep(30) every 10,000. –Klaus D. Jul 23 at 3:29 You are correct, wit
Sign in Pricing Blog Support Search GitHub This
Socket Error Errno 10060
repository Watch 17 Star 75 Fork 42 namecoin/nmcontrol forked socket error errno 10049 from khalahan/nmcontrol Code Issues 42 Pull requests 6 Projects 0 Pulse Graphs New socket error errno 10048 issue OS X: error: [Errno 49] Can't assign requested address #116 Closed rinchen opened this Issue Nov 11, 2015 · 23 comments http://stackoverflow.com/questions/38537686/python-i-get-socket-error-errno-49-cant-assign-requested-address-after-op Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 4 participants rinchen commented Nov 11, 2015 $ sudo ./nmcontrol.py --daemon=0 2015-11-10 20:50:16,036 - __main__ - INFO - ####################################################### Bottle v0.12.9 server starting up (using WSGIRefServer())... Listening on https://github.com/namecoin/nmcontrol/issues/116 http://127.0.0.2:8080/ Hit Ctrl-C to quit. 2015-11-10 20:50:16,076 - __main__ - INFO - Plugins started : domain, http, dns, systray 2015-11-10 20:50:16,076 - pluginSystray - INFO - pluginSystray: Sorry, the systray icon is only available on Windows so far. Exception in thread http: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/Users/joey/nmcontrol/lib/plugin.py", line 49, in run self.start2() File "/Users/joey/nmcontrol/lib/plugin.py", line 68, in start2 return self.pStart() File "/Users/joey/nmcontrol/plugin/pluginHttp.py", line 124, in pStart run(host=self.conf['host'], port=int(self.conf['port'])) File "/usr/local/lib/python2.7/site-packages/bottle.py", line 3117, in run server.run(app) File "/usr/local/lib/python2.7/site-packages/bottle.py", line 2771, in run srv = make_server(self.host, self.port, app, server_cls, handler_cls) File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/simple_server.py", line 151, in make_server server = server_class((host, port), handler_class) File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 420, in __init__ self.server_bind() File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind HTTPServer.server_bind(self) File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind SocketServer.TCPServer.server_bind(self) File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/p
the error reported. errno values are set when the return code is negative. errno Code Table The values of errno shown in this table are returned to C socket library applications when the return value is -1: errno Name http://www.workers.com.br/manuais/53/html/tcp53/mu/mu-7.htm Value Description EPERM 1 Not owner ENOENT 2 No such file ESRCH 3 No such process EINTR 4 Interrupted system EIO 5 I/O error ENXIO 6 No such device E2BIG 7 Argument list too long ENOEXEC 8 Exec format error EBADF 9 Bad file number ECHILD 10 No children EAGAIN 11 No more processes ENOMEM 12 Not enough core EACCES 13 Permission denied EFAULT 14 Bad address ENOTBLK 15 Block device required EBUSY socket error 16 Mount device busy EEXIST 17 File exists EXDEV 18 Cross-device link ENODEV 19 No such device ENOTDIR 20 Not a directory EISDIR 21 Is a directory EINVAL 22 Invalid argument ENFILE 23 File table overflow EMFILE 24 Too many open file ENOTTY 25 Not a typewriter ETXTBSY 26 Text file busy EFBIG 27 File too large ENOSPC 28 No space left on ESPIPE 29 Illegal seek EROFS 30 Read-only file system EMLINK 31 socket error errno Too many links EPIPE 32 Broken pipe EWOULDBLOCK 35 Operation would block EINPROGRESS 36 Operation now in progress EALREADY 37 Operation already in progress ENOTSOCK 38 Socket operation on EDESTADDRREQ 39 Destination address required EMSGSIZE 40 Message too long EPROTOTYPE 41 Protocol wrong type ENOPROTOOPT 42 Protocol not available EPROTONOSUPPORT 43 Protocol not supported ESOCKTNOSUPPORT 44 Socket type not supported EOPNOTSUPP 45 Operation not supported EPFNOSUPPORT 46 Protocol family not supported EAFNOSUPPORT 47 Address family not supported EADDRINUSE 48 Address already in use EADDRNOTAVAIL 49 Can't assign requested address ENETDOWN 50 Network is down ENETUNREACH 51 Network is unreachable ENETRESET 52 Network dropped connection ECONNABORTED 53 Software caused connection ECONNRESET 54 Connection reset by peer ENOBUFS 55 No buffer space available EISCONN 56 Socket is already connected ENOTCONN 57 Socket is not connected ESHUTDOWN 58 Can't send after shutdown ETOOMANYREFS 59 Too many references ETIMEDOUT 60 Connection timed out ECONNREFUSED 61 Connection refused ELOOP 62 Too many levels of nesting ENAMETOOLONG 63 File name too long EHOSTDOWN 64 Host is down EHOSTUNREACH 65 No route to host ENOTEMPTY 66 Directory not empty EPROCLIM 67 Too many processes EUSERS 68 Too many users EDQUOT 69 Disc quota exceeded ESTALE 70 Stale NFS file handle EREMOTE 71 Too many levels of remote in the path ENOSTR 72 Device is not a st