X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/27e903c56380abcb11b5a0b8d7ccab88a14b5cde..c1aeb5145ef5940247379a3d5a1be00913c0b4b8:/lsocket.pas diff --git a/lsocket.pas b/lsocket.pas index 642ec9a..6a1ce0b 100755 --- a/lsocket.pas +++ b/lsocket.pas @@ -419,6 +419,7 @@ begin if (addr = '::') and (origaddr = '') and (fdhandlein < 0) then begin {writeln('failed to create an IPV6 socket with error ',socketerror,'. trying to create an IPV4 one instead');} addr := '0.0.0.0'; + biniptemp := ipstrtobinf(addr); fdhandlein := socket(PF_INET,socktype,0); end; {$endif} @@ -448,6 +449,9 @@ begin end; end; + {$else} + SetSockOpt(fdhandlein, SOL_SOCKET, SO_REUSEADDR, 'TRUE', Length('TRUE')); + {$endif} localaddr := addr; localport := port; @@ -586,7 +590,7 @@ begin destx := {$ifdef win32}winsock.pSockAddr{$else}pInetSockAddrV{$endif}(@dest) end; {$else} - destx := {$ifdef win32}winsock.pSockAddr{$else}pInetSockAddrV{$endif}(@dest) + destx := {$ifdef win32}winsock.pSockAddr{$else}pInetSockAddrV{$endif}(@dest); {$endif} result := {$ifdef win32}winsock.sendto{$else}system_sendto{$endif}(self.fdhandleout,data^,len,0,destx^,destlen);