Trying to write a raw tcp connection

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.

<?php

$host1 = "192.168.1.81";
$port = "8001";

$pserv1 = pfsockopen($host1, $port);
fclose($pserv1);
?>

Comments

  • [red]
    why do you use a persistant connection? try

    http://php.net/fsockopen/
    instead of
    http://php.net/pfsockopen/

    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.
    [/red]

    : 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.
    :
    : <?php
    :
    : $host1 = "192.168.1.81";
    : $port = "8001";
    :
    : $pserv1 = pfsockopen($host1, $port);
    : fclose($pserv1);
    : ?>
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    http://mark.space.servehttp.com

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion