\r
procedure tlsocket.listen;\r
var\r
- yes:longint;\r
+ yes,no:longint;\r
socktype:integer;\r
biniptemp:tbinip;\r
origaddr:string;\r
try\r
yes := $01010101; {Copied this from existing code. Value is empiric,\r
but works. (yes=true<>0) }\r
+ no := 0;\r
{$ifndef win32}\r
if SetSocketOptions(fdhandlein, SOL_SOCKET, SO_REUSEADDR,yes,sizeof(yes))=-1 then begin\r
raise ESocketException.create('unable to set socket options');\r
end;\r
+ if SetSocketOptions(fdhandlein, IPPROTO_IPV6,IPV6_V6ONLY,no,sizeof(no))=-1 then begin\r
+ raise ESocketException.create('unable to set socket options');\r
+ end;\r
{$endif}\r
localaddr := addr;\r
localport := port;\r