Cannot connect to socket server.
Posted: Fri Nov 29, 2013 11:21 pm
Hi all
Trying to create a simple python socket server in Rpi
This seems to run ok. Prints the Socket created line and sits there.
However i am unable to connect to it.
From both Win7(with firewall off) and from Android i can ping the RPi local network ip.
However i get a connection refused if i try to open socket to the RPi.
Connection from own Rpi works.
Any ideas?
Thanks
Trying to create a simple python socket server in Rpi
Code: Select all
import socket
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print 'Socket Created'
host = socket.gethostname()
port=12345
s.bind((host,port))
s.listen(5)
while True:
c, addr = s.accept()
print 'Got', addr
c.send('Hello')
c.closeHowever i am unable to connect to it.
From both Win7(with firewall off) and from Android i can ping the RPi local network ip.
However i get a connection refused if i try to open socket to the RPi.
Connection from own Rpi works.
Any ideas?
Thanks