+ Fixed Connect call

This commit is contained in:
michael 1999-07-03 15:16:45 +00:00
parent 3eae7ee6fb
commit 06c7d3233f
4 changed files with 35 additions and 51 deletions

View File

@ -23,7 +23,7 @@ begin
textrec(f).mode:=fmclosed
else
case textrec(f).userdata[1] of
S_OUT : textrec(f).mode:=fmoutput;
S_OUT : textrec(f).mode:=fmoutput;
S_IN : textrec(f).mode:=fminput;
else
textrec(f).mode:=fmclosed;
@ -114,7 +114,7 @@ begin
DoAccept:=Accept(Sock,Addr,AddrLen);
end;
Function DoConnect(Sock:longint;const addr: TInetSockAddr): Longint;
Function DoConnect(Sock:longint;const addr: TInetSockAddr): Boolean;
begin
DoConnect:=Connect(Sock,Addr,SizeOF(TInetSockAddr));
@ -122,32 +122,18 @@ end;
Function Connect(Sock:longint;const addr: TInetSockAddr;var SockIn,SockOut:text):Boolean;
Var FD : Longint;
begin
FD:=DoConnect(Sock,addr);
If Not(FD=-1) then
begin
Sock2Text(FD,SockIn,SockOut);
Connect:=true;
end
else
Connect:=false;
Connect:=DoConnect(Sock,addr);
If Connect then
Sock2Text(Sock,SockIn,SockOut);
end;
Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:file):Boolean;
Var FD : Longint;
begin
FD:=DoConnect(Sock,addr);
If Not (FD=-1) then
begin
Sock2File(FD,SockIn,SockOut);
Connect:=true;
end
else
Connect:=false;
Connect:=DoConnect(Sock,addr);
If Connect then
Sock2File(Sock,SockIn,SockOut);
end;
Function Accept(Sock:longint;var addr:TInetSockAddr;var SockIn,SockOut:text):Boolean;
@ -179,7 +165,10 @@ begin
end;
{
$Log$
Revision 1.1 1999-06-21 12:26:27 florian
Revision 1.2 1999-07-03 15:16:45 michael
+ Fixed Connect call
Revision 1.1 1999/06/21 12:26:27 florian
+ files created by splitting the linux sockets unit
}

View File

@ -58,7 +58,7 @@ Function Recv(Sock:Longint;Var Addr;AddrLen,Flags:Longint):Longint;
Function Bind(Sock:Longint;Var Addr;AddrLen:Longint):Boolean;
Function Listen (Sock,MaxConnect:Longint):Boolean;
Function Accept(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Longint;
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):boolean;
Function Shutdown(Sock:Longint;How:Longint):Longint;
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
Function GetPeerName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
@ -80,7 +80,10 @@ Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:file):
{
$Log$
Revision 1.1 1999-06-21 12:26:27 florian
Revision 1.2 1999-07-03 15:16:46 michael
+ Fixed Connect call
Revision 1.1 1999/06/21 12:26:27 florian
+ files created by splitting the linux sockets unit
}

View File

@ -167,12 +167,10 @@ end;
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Longint;
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint): boolean;
begin
Connect:=SocketCall(Socket_Sys_Connect,Sock,longint(@Addr),AddrLen);
If Connect<0 Then
Connect:=-1;
Connect:=SocketCall(Socket_Sys_Connect,Sock,longint(@Addr),AddrLen)=0;
end;
@ -255,7 +253,7 @@ end;
Function DoConnect(Sock:longint;const addr:string):Longint;
Function DoConnect(Sock:longint;const addr:string):Boolean;
var
UnixAddr : TUnixSockAddr;
AddrLen : longint;
@ -301,31 +299,19 @@ Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:text):Boolean
Var FD : Longint;
begin
FD:=DoConnect(Sock,addr);
If Not(FD=-1) then
begin
Connect:=DoConnect(Sock,addr);
If Connect then
Sock2Text(Sock,SockIn,SockOut);
Connect:=true;
end
else
Connect:=false;
end;
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:file):Boolean;
Var FD : Longint;
begin
FD:=DoConnect(Sock,addr);
if Not(FD=-1) then
begin
Connect:=DoConnect(Sock,addr);
if Connect then
Sock2File(Sock,SockIn,SockOut);
Connect:=true;
end
else
Connect:=false;
end;
{$i sockets.inc}
@ -334,7 +320,10 @@ end.
{
$Log$
Revision 1.8 1999-06-27 16:04:25 michael
Revision 1.9 1999-07-03 15:16:47 michael
+ Fixed Connect call
Revision 1.8 1999/06/27 16:04:25 michael
+ Updated to Florians system independent sockets unit
Revision 1.7 1999/06/08 18:35:24 michael

View File

@ -109,11 +109,11 @@ begin
SocketError:=0;
end;
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Longint;
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Boolean;
begin
Connect:=WinSock.Connect(Sock,WinSock.TSockAddr(Addr),AddrLen);
if Connect<0 then
Connect:=WinSock.Connect(Sock,WinSock.TSockAddr(Addr),AddrLen)=0;
if Connect then
SocketError:=WSAGetLastError
else
SocketError:=0;
@ -211,7 +211,10 @@ finalization
end.
{
$Log$
Revision 1.1 1999-06-21 12:40:48 florian
Revision 1.2 1999-07-03 15:16:48 michael
+ Fixed Connect call
Revision 1.1 1999/06/21 12:40:48 florian
+ initial revision, derieved from the linux version
}