foens / hpop

OpenPOP.NET code repository
http://hpop.sourceforge.net/
204 stars 114 forks source link

Connecting to POP3 server using IPv6 fails #90

Open microlite opened 3 years ago

microlite commented 3 years ago

If you try and connect to a POP3 server using IPv6 you get the following error: "A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using sendto) no address was supplied."

I managed to make it work by changing the constructor of the TcpClient as follows: TcpClient clientSocket = new TcpClient(AddressFamily.InterNetworkV6);

The above modification works with both IPv4 and IPv6 addresses but I'm not sure if its the best approach.