So, I'm designing a project page for a gCn program, and I wanted to, on the page, indicate the online status of the bridge. And have some sort of colored dot, where green is online and good, orange is online but lagging, and red is offline or error. I'm trying to do this in PHP. I came across the fsockopen() call.
Code:
Now, what do I do from there to send a packet and test for a certain packet back? Basically I want to send a packet out with just a type byte, and receive back a 8-byte packet (2-byte bridge version, 3-byte latest client version, 3-byte earlier supported client).
Code:
function check_gCnBridgeActive () {
$host = "127.0.0.1";
$port = "8888";
$conn = fsockopen( $host, $port);
Now, what do I do from there to send a packet and test for a certain packet back? Basically I want to send a packet out with just a type byte, and receive back a 8-byte packet (2-byte bridge version, 3-byte latest client version, 3-byte earlier supported client).