October 17th, 1999, 11:58 AM
I have some data and I have to send it to specified port via TCP/IP. Generally it should work like this:
I make file with data (this is not problem which I send.I don't know how to do this exactly.
Do you have any ideas how to do this?
December 11th, 1999, 01:19 AM
In order to open a TCP socket use the fsockopen function. Then you fread or fwrite with the correct file handle and then fclose at the end.
Here is an example below:
$port_no = 21;
$timeout = 30;
$fp = fsockopen("192.168.0.1", $port_no , &$errno, &$errstr, $timeout);