0

I have met the error:

socket.error: [Errno 98] Address already in use

Then I go to that port to find if something in there by:

netstat -ant | grep :5000
# result is
tcp        0      0 127.0.0.1:5000          0.0.0.0:*               LISTEN

being listened, I do not know what process it is. Is there any way to clean this socket?

kenorb
  • 118,428
  • 63
  • 588
  • 624
Hello lad
  • 13,374
  • 29
  • 103
  • 174
  • 1
    As root you can use the `-p` flag to `netstat`/`ss` to find out the listening process. – Etan Reisner Nov 04 '14 at 16:36
  • I do not have root privilege @Etan Reisner – Hello lad Nov 04 '14 at 16:38
  • Duplicate: [How to check which process in bound to a particular port?](http://stackoverflow.com/questions/14229028/check-which-process-in-bound-to-a-particular-port). – kenorb Nov 04 '14 at 16:40
  • @Hellolad If you don't have root privilege, how you want to kill that process then when you know which one it is? – kenorb Nov 04 '14 at 16:43
  • Try: `lsof -i` (it's not by default, so you've to install it if you can). – kenorb Nov 04 '14 at 16:44
  • `fuser -v 5000/tcp` should give you the pid – Padraic Cunningham Nov 04 '14 at 16:47
  • possible duplicate of [What port is a given program using?](http://stackoverflow.com/questions/105418/what-port-is-a-given-program-using) – kenorb Nov 04 '14 at 16:48
  • See also: [How to check opened/closed port on my computer?](http://askubuntu.com/questions/538208/how-to-check-opened-closed-port-on-my-computer), [Unable to bind to port 80 [bitnami, OSQA, Ubuntu 12.04](http://askubuntu.com/questions/269718/unable-to-bind-to-port-80-bitnami-osqa-ubuntu-12-04). – kenorb Nov 04 '14 at 16:49

0 Answers0