0

so assume I have a socket called S, it's listening for tcp requests

IP address X sent a connection request, at this stage I have the option to accept it, but first I want to just print the IP address

there is no error I straight up don't have the slightest idea on how to do this, I tried googling, went thru the docs, nothing was of any help, thanks in advance guys

  • If you just print the IP address and then `accept()` the connection anyway, why not `accept()` it and _then_ print the IP address that is returned? – Thomas Jul 26 '22 at 10:43
  • Note that the underlying POSIX APIs don't support this, as far as I can tell, so it might be straight up impossible. – Thomas Jul 26 '22 at 10:48

0 Answers0