socket deadlock

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Felix Bollenbeck

    socket deadlock

    Hello all!

    Im getting started learning php at the moment...with some difficulties:
    I want to comunicate with a java server via sockets:

    $socket = socket_create(A F_INET,SOCK_STR EAM,SOL_TCP);
    $connection = socket_connect( $socket,'localh ost',3141);
    socket_write($s ocket,"someUser Id");
    while($data = socket_read($so cket,3141))
    {
    echo $data;
    }

    write and read seperatly are fine, but in combination they produce some
    deadlock causing a timeout! I googeled a good bit, but couldnt get
    ahead.

    can you give me any hints for this problem?

    TIA,

    felix.

Working...