0

I am learning network and for some reason I get an error with the bind line and I do not see why, help?

Server_Socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Server_Socket.bind(('127.0.0.1', 80))
Server_Socket.listen(10)
4
  • Do you have another webserver or program running on your machine that may be using that port? Commented Jul 6, 2017 at 12:10
  • @DarnellMartin I have other computer which my siblings use, how can I see if they are may be using this port? Commented Jul 6, 2017 at 12:13
  • Try changing the port number from 80 to 8080 and check if it still gives you an error. Commented Jul 6, 2017 at 12:17
  • @DarnellMartin Thank you, it was to port :) Commented Jul 6, 2017 at 12:32

1 Answer 1

2

In case someone comes across this error in the future, this exception is typically thrown in the event that another program is already bound to that port. Try changing the port from a popular port i.e(80,443,161..etc) to something above 1024 to be "safe" not to interfere with any other programs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.