My server software says
errno99: cannot assign requested address
backlog = 5
size = 1024
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
input = [server]
running = 1
inputready,outputready,exceptready = select.select(input,,)
for s in inputready:
if s == server:
client, address = server.accept()
l = s.recv(1024)
s = socket.socket()
f=open ("hello1.txt", "rb")
l = f.read(1024)
l = f.read(1024)
Stripping things down to basics this is what you would want to test with:
import socket server = socket.socket() server.bind(("10.0.0.1", 6677)) server.listen(4) client_socket, client_address = server.accept() print(client_address, "has connected") while 1==1: recvieved_data = s.recv(1024) print(recvieved_data)
This works assuming a few things:
Try the following, open the start menu, in the "search" field type
cmd and press enter.
Once the black console opens up type
ping www.google.com and this should give you and IP address for google. This address is googles local IP and they bind to that and obviously you can not bind to an IP address owned by google.
With that in mind, you own your own set of IP addresses.
First you have the local IP of the server, but then you have the local IP of your house.
In the below picture
192.168.1.50 is the local IP of the server which you can bind to.
You still own
22.214.171.124 but the problem is that it's owned by the Router and not your server. So even if you visit http://whatsmyip.com and that tells you that your IP is
126.96.36.199 that is not the case because it can only see where you're coming from.. and you're accessing your internet from a router.
In order for your friends to access your server (which is bound to
192.168.1.50) you need to forward port
192.168.1.50 and this is done in your router.
Assuming you are behind one.
If you're in school there's other dilemmas and routers in the way most likely.