Error Errno 48 Address Already In Use
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 socket.error errno 48 address already in use hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Python Socket.error Errno 48 Address Already In Use
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Python Socket.error Errno 98 Address Already In Use
Join them; it only takes a minute: Sign up socket.error: [Errno 48] Address already in use up vote 60 down vote favorite 33 I'm trying to set up a server with python from mac terminal. I navigate to
Socket Error Address Already In Use Python
folder location an use: python -m SimpleHTTPServer But this gives me error: socket.error: [Errno 48] Address already in use I had previously open a connection using the same command for a different website in a different location in my machine. python simplehttpserver share|improve this question edited Feb 18 '15 at 0:19 asked Sep 28 '13 at 20:48 irm 48531225 1 Kill the other process or run this one with a different port: python -m SimpleHTTPServer 8081 –Blender errno 98 address already in use Sep 28 '13 at 20:50 add a comment| 3 Answers 3 active oldest votes up vote 131 down vote accepted You already have a process bound to the default port (8000). If you already ran the same module before, it is most likely that process still bound to the port. Try and locate the other process first: $ ps -fA | grep python 501 81651 12648 0 9:53PM ttys000 0:00.16 python -m SimpleHTTPServer The command arguments are included, so you can spot the one running SimpleHTTPServer if more than one python process is active. You may want to test if http://localhost:8000/ still shows a directory listing for local files. The second number is the process number; stop the server by sending it a signal: kill 81651 Alternatively, run the server on a different port, by specifying the alternative port on the command line: $ python -m SimpleHTTPServer 8910 Serving HTTP on 0.0.0.0 port 8910 ... then access the server as http://localhost:8910; where 8910 can be any number from 1024 and up, provided the port is not already taken. share|improve this answer edited Sep 28 '13 at 21:04 answered Sep 28 '13 at 20:54 Martijn Pieters♦ 499k7412911449 What url should I have in browser to see if it is working? I'm running on a different port as you sugested –irm Sep 28 '13 at 21:02 @irm: http://localhost:
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 python socket.error errno 99 cannot assign requested address Stack Overflow the company Business Learn more about hiring developers or posting ads django error errno 48 address already in use with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow shadowsocks socket error errno 98 address already in use is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Socket error: Address already in use up vote 2 down vote favorite 4 http://stackoverflow.com/questions/19071512/socket-error-errno-48-address-already-in-use I have a CherryPy script that I frequently run to start a server. Today I was having to start and stop it a few times to fix some bugs in a config file, and I guess the socket didn't close all the way because when I tried to start it up again I got this issue: [23/Mar/2015:14:08:00] ENGINE Listening for SIGHUP. [23/Mar/2015:14:08:00] ENGINE Listening for SIGTERM. [23/Mar/2015:14:08:00] ENGINE Listening for http://stackoverflow.com/questions/29217502/socket-error-address-already-in-use SIGUSR1. [23/Mar/2015:14:08:00] ENGINE Bus STARTING CherryPy Checker: The Application mounted at '' has an empty config. [23/Mar/2015:14:08:00] ENGINE Started monitor thread 'Autoreloader'. [23/Mar/2015:14:08:00] ENGINE Started monitor thread '_TimeoutMonitor'. [23/Mar/2015:14:08:00] ENGINE Error in HTTP server: shutting down Traceback (most recent call last): File "/home/andrew/virtualenvs/mikernels/lib/python2.7/site-packages/cherrypy/process/servers.py", line 188, in _start_http_thread self.httpserver.start() File "/home/andrew/virtualenvs/mikernels/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1848, in start raise socket.error(msg) error: No socket could be created I edited CherryPy's wsgiserver2.py to see the details of the socket.error and error.strerror was 98 (98, 'Address already in use') Address already in use Meanwhile my socket is constructed as: af = 2 socktype = 1 proto = 6 canonname = '' sa = ('0.0.0.0', 2112) self.bind(af, socktype, proto) (that's not exact code but that's what the values are when the error is fired) I checked netstat and didn't see anything listening on port 2112, what could be causing the problem and how can I go about diagnosing it? Thanks! python sockets cherrypy share|improve this question asked Mar 23 '15 at 18:16 Andrew Latham 1,97572259 add a comment| 3 Answers 3 active oldest votes up vote 8 down vote accepted You can try the following from socket import * sock=socket() sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) # then bind From the docs: The SO_REUSEADDR flag tells the k