here what i ended up doing:
Server P.C:
Code:
import sys, socket
host='192.168.0.100'
port=1024
# create the server socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind( (host, port) )
s.listen(5) # start the server socket
print "waiting of the client to connect:"
(client, address) = s.accept()
print "accepted connection from %s:%d" % (address[0], address[1])
while True:
data = client.recv(1024)
if len(data) == 0:
print "connection with %s closed." % address[0]
break
sys.stdout.write(data)
client.close()
Client N95:
Code:
import socket
import sys
import e32
import axyz
host='192.168.0.100'
port=1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "trying to connect to socket:"
s.connect( (host, int(port) ) )
#def sendData(x,y,z):
# print "x: %i y: %i z: %i"%(x,y,z)
s.send('Test')
axyz.connect(sendData)
print "connected. Sending Accelerometer Data."
e32.ao_sleep(30)
print "closing connection with server"
c.close()
axyz.disconnect()
but for some reason it doesn't seem to work, i am using an Ad-Hoc connection with my laptop which has an i.p of 192.168.0.100, is there anything i am doing wrong ?