why do you use a persistant connection? try
btw: there can be MANY problems, it doesnt have to be php related, although it can be. at least i don't see a problem with your tiny example code. and usually, these tiny pieces of code that do a single thing with mostly a single function work properly.
: I have been working on this for 2 days with little luck. Can someone give me some links to some sites that explain more about raw tcp and what it takes to make the connection. This is my code. It keeps telling me can not connect, but sometimes it does connect. The code is to connect to a serial port server that has a device attached via serial connection. Thanks ahead of time for any responses.
: $host1 = "192.168.1.81";
: $port = "8001";
: $pserv1 = pfsockopen($host1, $port);