I wrote:
> Worse case: I will look into the freepascal sockets unit.. and see the source
> code in their Bind() function and maybe see what differences there are.. and
> verify the bind function in sockets.pp even works itself with WSAGetLastError
> and WSAStartup.

program test; {$mode objfpc} {$H+}

uses sockets, winsock2;

var
  S        : Longint;
  SAddr    : TInetSockAddr;

procedure perror (const S:string);
begin
  writeln ('ERROR: ', S, WsaGetLastError); // right here!!
end;

begin
  S:=Socket (AF_INET,SOCK_STREAM,0);
  if SocketError<>0 then Perror ('Socket : ');
  SAddr.sin_family:=AF_INET;
  { port 80 in network order }
  SAddr.sin_port:=htons(80);
  SAddr.sin_addr.s_addr:=0;
  if not sockets.Bind(S,SAddr,sizeof(saddr)) then
    PError ('Bind : ');
  // right here!!
end.

...program output...
ERROR: Server : Bind : 10048

(because I have apache open already on port 80)

Whereas synapse reports: zero on fpc, but 10048 on delphi.

So now it is just a matter of comparing it to synapse Windows API calls to see
what differences there are!

L505


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to