1

In the code;

import socket
HOST = ''   #another short form for INADDDR_ANY, all available interfaces
PORT = 50010 #arbitrary non-priviledged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))

s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr

I am getting an error

socket.error: [Errno 10013] An attempt was made to access a socket in a way forb
idden by its access permissions

The error points to s.bind(). Any clues as to why this is happening? Basically, I don't want to change the port number each time I make some changes to server code.

hershey92
  • 773
  • 2
  • 5
  • 13

0 Answers0