So you need to store the socket pointer when you accept the connection. Where you store it is up to you.