blocking socket client example
<p>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.</p>

<p>So far i have tried this basic example with no luck.</p>

<p>import socket
import sys</p>

<p>HOST, PORT = "172.16.10.5", 15142
data = " ".join(sys.argv[1:])</p>

<p>sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((HOST, PORT))
print "connected"</p>

<p>sock.send(data + "\n")
print "data sent"</p>

<p>received = sock.recv(1024)
print "data received"
sock.close()</p>

<p>print "Sent:     %s" % data
print "Received: %s" % received</p>

<p>the script just hangs forever after sock.send 
do anyone of you know of a good example?
regards</p>
