When I use socket_connect
it connects.
But I need to pass a command, and read the data afterwards.
When I use socket_bind
I get socket_bind(): unable to bind address [99]: Cannot assign requested address
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket
");
$result = socket_bind($socket, 'x.x.x.x', 1939);
This is what I need to do:
This is for a Chinese access controller.
Have also tried this:
$result = socket_connect($socket, $host, $port);
$result = socket_sendto($socket, '0x41', strlen('0x41'), 0, $host, $port);
And
$result = socket_write($socket, '0x41', strlen('0x41'));
Any help on how to accomplish this? Very much a newb to sockets so a bit lost at what it is I have to do.