Hi everyone. I'm tasked with exchanging data with another machine via TCP. I have a pretty good understanding of web architecture overall, but working with sockets is new to me and I seem to be missing something. When I use this, it fails:
$remote_machine = fsockopen($destination,$port,$error_number,$error_message,5) or die($error_message . " " . $error_number);
(
$destination
is an IP address, and
$port
in this case is 63333.)
When executed, this fails with 'Connection refused (111)'. Which makes sense, since this system requires username / password authentication.
What I'm failing to understand is how I get the username and password to the system. I've read several 'tutorials' online and they all show this information being passed
after the connection is established.
If I can get authenticated, I must then receive and respond to some JSON formatted data, if that's noteworthy.
Can someone help me understand the process here?