Hello, i need to connect to a blocking service using tcp ports (if someone here knows about it, it is a motorola digital wirelink protocol service) , i need a good starting point example, ideally in perl, python or php which are the languages i know better.
So far i have tried this basic example with no luck.
import socket import sys
HOST, PORT = "172.16.10.5", 15142 data = " ".join(sys.argv[1:])
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((HOST, PORT)) print "connected"
sock.send(data + "\n") print "data sent"
received = sock.recv(1024) print "data received" sock.close()
print "Sent: %s" % data print "Received: %s" % received
the script just hangs forever after sock.send do anyone of you know of a good example? regards