I am tying to write several messages (each message created dynamically) to a device through one socket created with PHP. The first message always goes through; but, subsequent messages do not go through. To help me debug, please let me know if there is a problem with this example:
$socket= socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, $ip, $port);
socket_write($socket, "message 1\r");
socket_write($socket, "message 2\r");
echo socket_strerror()give you?