Embarcadero Rad Studio Firemonkey Indy POP3 IPv6 socket error 11004

  

I have the following problem. I use Embarcadero Rad Studio 10.1 Berlin Firemonkey. I want to connect to a POP3 server within an IPv6 network where IPv4 is not enabled and I get the socket error # 11004 error. My code is:

int port = 110;
pop3->Host = …
pop3->Username = …
pop3->Password = ..
pop3->AuthType = patUserPass;
pop3->IOHandler = iOHandlerStack;
iOHandlerStack->IPVersion = TIdIPVersion::Id_IPv6;
pop3->UseTLS = utNoTLSSupport;
pop3->Port = port;
iOHandlerStack->Port = port;
try
{
pop3->ConnectTimeout = 5000;
pop3->Connect();
int msgc = pop3->CheckMessages();
pop3->Disconnect();
ShowMessage(“OK: ” + IntToStr(msgc));
}
catch (Exception &exc)
{
ShowMessage(exc.Message);
}

If I use the application within an IPv4 network then after connecting the IPVersion property is set to Id_IPv4 automatically and there is no problem.

Interesting thing is that the following code works within IPv6 network:

IdTCPClient->IPVersion = TIdIPVersion::Id_IPv6;
IdTCPClient->Host = …
IdTCPClient->Port = 80;
IdTCPClient->Connect();
IdTCPClient->Disconnect();
ShowMessage(“OK”);

Any suggestion?

Comments are closed.