Coder Social home page Coder Social logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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

from python-for-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 [email protected] on 9 May 2012 at 12:35

from python-for-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
Has there been any advancement in this code?

Original comment by [email protected] on 17 May 2012 at 2:42

from python-for-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 [email protected] on 17 May 2012 at 6:24

from python-for-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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

  • Changed state: WontFix

from python-for-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.