Saturday, August 23, 2008

how to write to a server running on a certain port using php client

Lets say i have a server running on a machine on a certain port number...

ex: serverIP :192.168.1.103
    port :3201

Now i will need a php script to write to that server..
Here is the logic..
create a stream socket client using the function : stream_socket_client() function.
and assign it to a variable... this variable will be like a file pointer..
then just user fwrite() function to write to that stream..
dont forget to close the file pointer..
Thats it problem solved..
Blogged with the Flock Browser

No comments: