X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/2d2676149292e4e388bb102a41a3d64349ac88ed..f102aba78918f31feeb2b3d8a685faa7ebfd20be:/lsocket.pas diff --git a/lsocket.pas b/lsocket.pas index f7d40e3..c099cf5 100755 --- a/lsocket.pas +++ b/lsocket.pas @@ -369,7 +369,7 @@ end; procedure tlsocket.listen; var - yes:longint; + yes,no:longint; socktype:integer; biniptemp:tbinip; origaddr:string; @@ -408,10 +408,14 @@ begin try yes := $01010101; {Copied this from existing code. Value is empiric, but works. (yes=true<>0) } + no := 0; {$ifndef win32} if SetSocketOptions(fdhandlein, SOL_SOCKET, SO_REUSEADDR,yes,sizeof(yes))=-1 then begin raise ESocketException.create('unable to set socket options'); end; + if SetSocketOptions(fdhandlein, IPPROTO_IPV6,IPV6_V6ONLY,no,sizeof(no))=-1 then begin + raise ESocketException.create('unable to set socket options'); + end; {$endif} localaddr := addr; localport := port;