I’m studing c++ socket programming…
The server program binds to a socket and starts listening for connection requests…ok now how can I list the IP addreses of the listened requests?
I know I can get the IP addresses after accepting the connections but lets say I don’t wanna accept a connection from an specific IP address…
I’m studing c++ socket programming… The server program binds to a socket and starts
Share
For optimum performance, this would be solved by filtering in the network stack, but the details of doing that will depend on the operating system (this is not part of the socket interface and your application may generally not even have the rights to configure your network stack this way.)
The other opportunity is after the
accept, by which time the connection is already accepted (CONNECT ACK) on TCP level.I don’t think you can do it in the middle phase where you would prefer that. That however would not be very different from doing it after
acceptanyway.