Oduabuna Francis wrote:Hi.
Is there a way in which a I can program a server to be the one to pickup requests from a client (whose IP address and port is stated) instead of the client forwarding the requests to it. I know for normal sockets I would have to create a server as follows:
What if I want the server to be the one to pick a request from a client of IP address x.x.x.x on port 8081, what should I do?
Not sure what you mean by "pick a request from a client of IP address x.x.x.x on port 8081"? Are you asking to see if it can only accept from certain addresses and port? If so, then no -- not really... but ... after accepting, I guess you can check the remote address and port, and close the socket if it is not within the range that you want. Does that work?
If this is not what you mean, then please elaborate.
Henry