Hello,
I have simple python script that runs on a linux board with USB Modem.
The code nicely sends the data to the API and then it sends out an email, however I never get any response back from the sever.
…What am I missing? Thanks
I know the socket.recv is blocking but shouldn’t the server reply back with OO?
Also aaaa,bbbb are my Shared keys…
# Hello world python program
from socket import socket
import sys
import time
sock = socket()
sock.connect(('23.253.146.203', 9999))
try:
# Send data
message = '{\"s\":\"aaaa\", \"c\":\"bbbb", \"d\":\"Hello,1444PM World!\", \"t\":[\"_SOCKETAPI_\"]}'
print >>sys.stderr, 'sending "%s"' % message
sock.sendall(message)
print >>sys.stderr, 'Waiting'
time.sleep(3)
buff = sock.recv(2) # Never receives OO back --- just hangs here
print >>sys.stderr, buff
finally:
print >>sys.stderr, 'closing socket'
sock.close()