I am trying to create a client application that will use asynchronous IO using IOCP. I already did similar server application and it works correctly, however I can't find any information on how to extract local endpoint information from socket that is connected via ConnectEx
API.
With server sockets, documentation states that info about both local and remote endpoints will be part of buffer sent to the AcceptEx
. There is not a similar thing in ConnectEx
. I tried also to extract local endpoint information through getsockname
, however this returned some garbage values. I also tried to use setsockopt(clientSocket, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, ...)
prior to calling getsockname
, however the result was same as without it. Is there a way to do this or am I misunderstanding something?