lcore.org gitweb
/
lcore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix build in various fpc versions on linux
[lcore.git]
/
lsocket.pas
diff --git
a/lsocket.pas
b/lsocket.pas
index f7d40e39679925f4c9f13493bd57eb5121e435c1..c099cf57e9ea8ea8916cabd9bd9cd1ffad86bbf5 100755
(executable)
--- a/
lsocket.pas
+++ b/
lsocket.pas
@@
-369,7
+369,7
@@
end;
\r
procedure tlsocket.listen;
\r
var
\r
\r
procedure tlsocket.listen;
\r
var
\r
- yes:longint;
\r
+ yes
,no
:longint;
\r
socktype:integer;
\r
biniptemp:tbinip;
\r
origaddr:string;
\r
socktype:integer;
\r
biniptemp:tbinip;
\r
origaddr:string;
\r
@@
-408,10
+408,14
@@
begin
try
\r
yes := $01010101; {Copied this from existing code. Value is empiric,
\r
but works. (yes=true<>0) }
\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
{$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
{$endif}
\r
localaddr := addr;
\r
localport := port;
\r