1- when we use stream_socket_client() for connect from client A to B. we specify port of B and connect to it and port of A is random. can we specify port of A too ??
2- I use this code for accepting incoming connectiongs:
$a = stream_socket_server('tcp://localhost:9056');
$b = stream_socket_accept($a);
$c = fread($b,1000);
now how detect ip and port of incoming connection ??