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