lcore.org gitweb
/
lcore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make some os-x related fixes to lmessages
[lcore.git]
/
lsocket.pas
diff --git
a/lsocket.pas
b/lsocket.pas
index af3faf8553e5bf63a22e40a6df41f6e1f0cda2f9..c099cf57e9ea8ea8916cabd9bd9cd1ffad86bbf5 100755
(executable)
--- a/
lsocket.pas
+++ b/
lsocket.pas
@@
-177,10
+177,6
@@
end;
begin
\r
result := getpeername(sock,addr,addrlen);
\r
end;
\r
begin
\r
result := getpeername(sock,addr,addrlen);
\r
end;
\r
- function system_getsocketname(Sock: LongInt;var Addr;var Addrlen: LongInt):LongInt;
\r
- begin
\r
- result := getsocketname(sock,addr,addrlen);
\r
- end;
\r
function system_listen(Sock: LongInt; MaxConnect: LongInt):Boolean;
\r
begin
\r
result := listen(sock,maxconnect);
\r
function system_listen(Sock: LongInt; MaxConnect: LongInt):Boolean;
\r
begin
\r
result := listen(sock,maxconnect);
\r
@@
-373,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
@@
-412,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
@@
-690,7
+690,7
@@
begin
{$ifdef win32}
\r
winsock.getsockname(self.fdhandlein,psockaddr(@addr)^,i);
\r
{$else}
\r
{$ifdef win32}
\r
winsock.getsockname(self.fdhandlein,psockaddr(@addr)^,i);
\r
{$else}
\r
-
system_
getsocketname(self.fdhandlein,addr,i);
\r
+ getsocketname(self.fdhandlein,addr,i);
\r
{$endif}
\r
binip := inaddrvtobinip(addr);
\r
converttov4(binip);
\r
{$endif}
\r
binip := inaddrvtobinip(addr);
\r
converttov4(binip);
\r
@@
-741,7
+741,7
@@
begin
winsock.getsockname(self.fdhandlein,psockaddrin(@addr)^,i);
\r
\r
{$else}
\r
winsock.getsockname(self.fdhandlein,psockaddrin(@addr)^,i);
\r
\r
{$else}
\r
-
system_
getsocketname(self.fdhandlein,addr,i);
\r
+ getsocketname(self.fdhandlein,addr,i);
\r
\r
{$endif}
\r
result := inttostr(htons(addr.InAddr.port));
\r
\r
{$endif}
\r
result := inttostr(htons(addr.InAddr.port));
\r