Closed GoogleCodeExporter closed 9 years ago
a) Sockets do work and have been tested. However, built-in firewalls will
prevent you from binding to sockets below 1024. Please supply some example code.
b) This is a python question, not an sl4a question.
Original comment by rjmatthews62
on 8 May 2012 at 11:53
server (On the computer)
[code]
import socket
s = socket.socket()
s.bind(("192.168.56.1", 12345))
s.listen(1)
while True:
c, addr = s.accept()
c.send("test")
c.close()
print "done"
[/code]
Client (On android device)
[code]
import android
import socket
d = android.Android()
s = socket.socket()
s.connect(("192.168.56.1", 12345))
print s.recv(1024)
[/code]
Any idea on why this isn't working on my device?
Original comment by J.Rhynor...@gmail.com
on 9 May 2012 at 12:35
Has there been any advancement in this code?
Original comment by J.Rhynor...@gmail.com
on 17 May 2012 at 2:42
I found some interesting information today. When I run the following code, it
prints "True". Hope this will help in some way!
import socket
import android
d = android.Android()
s = socket.socket()
s.connect(("google.com", 80))
print True
Original comment by J.Rhynor...@gmail.com
on 17 May 2012 at 6:24
It has been tested and found to work, on several platforms.
Unless others can duplicate the problem, I have to assume it is something to do
with the original poster's network setup.
There is a lengthy thread on this in the discussion list.
If others have problem, please check your desktop firewall settings. Also,
network settings (some routers implement firewalls of their own.)
Original comment by rjmatthews62
on 17 May 2012 at 11:42
Original issue reported on code.google.com by
J.Rhynor...@gmail.com
on 8 May 2012 at 9:36