This happens because the Resource ID is a pointer to the socket, not the
socket itself.
You are storing the value of the resource ID (i.e. '1') in the database.
However, when you are pulling it out, you are pulling it out as an int, and
not a socket identifier.
Keep the socket identifier as a global variable/pointer, or pass it through
functions with the arguments.

----- Original Message -----
From: Gareth Thomas <[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 1:26 PM
Subject: [PHP] re-writing to the same socket

> Hi,
> I have some code that writes data to a socket (works fine) and stores the
> resource id created in a table with the column defined as varchar (80).
> the next time I need to write data to the same IP I retrieve the resource
> and reuse it. Problem is that the socket_write seems to work fine (it
> returns no error) and yet the data appears to disappear into the ether...I
> am using 4.2.3 client on Win2K and server on Linux.
> Anyone have any ideas.
> Any help much appreciated.
> G.
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to