Open zainqayyum954 opened 6 years ago
is there any command (for socket) not used by this library?
can i set a socket listener on machine? for example: when someone scan fingerprint, i will capture those details from socket.
Hi, You can make cronjobs.bat to save new data from device to mysql with loop 10 seconds. and call data saved from mysql to datatables like bootsrap datatables and make refresh automaticaly with oTable.fndraw(); this solution work with me.
thank u.
If your device has an adms function it can send it the host PC.
`<?php // by John Schimmel // modified from the code at http://www.zend.com/pecl/tutorials/sockets.php // // run this from terminal on mac os x or another command line interface.
// Set time limit to indefinite execution set_time_limit (0);
// Set the ip and port we will listen on $address = '192.168.2.140'; $port = 8081;
// Create a TCP Stream socket $sock = socket_create(AF_INET, SOCK_STREAM, 0); echo "PHP Socket Server started at " . $address . " " . $port . "\n";
// Bind the socket to an address/port socket_bind($sock, $address, $port) or die('Could not bind to address'); // Start listening for connections socket_listen($sock);
//loop and listen
while (true) { / Accept incoming requests and handle them as child processes / $client = socket_accept($sock);
// Read the input from the client – 1024 bytes
// Display output back to client
$message = '';
$next = '';
//loop through to continue appending until everything has been read
while($next = socket_read($client, 4096)){
$message .= $next;
}
echo $message;
$date = date('D, d M Y H:i:s');
socket_write($client, "HTTP/1.1 200 OK\r\nServer: nginx/0.8.12\r\nContent-Type: text/plain\r\nConnection: close\r\nDate: ".$date." GMT\r\nContent-Length: 2\r\n
OK:1\r\nPOST from: 3570180360214\r\n\r\n");
// display input on server side
}
// Close the client (child) socket socket_close($client);
// Close the master sockets socket_close($sock); ?>`
Hi,
You have to implement some kind of polling mechanism. TAD-PHP does not have any method for polling attendance.
Best regards,
El mié., 11 de abr. de 2018 3:49 a. m., zainqayyum954 < notifications@github.com> escribió: