mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 15:47:51 +02:00
+ Fixed Connect call
This commit is contained in:
parent
3eae7ee6fb
commit
06c7d3233f
@ -23,7 +23,7 @@ begin
|
|||||||
textrec(f).mode:=fmclosed
|
textrec(f).mode:=fmclosed
|
||||||
else
|
else
|
||||||
case textrec(f).userdata[1] of
|
case textrec(f).userdata[1] of
|
||||||
S_OUT : textrec(f).mode:=fmoutput;
|
S_OUT : textrec(f).mode:=fmoutput;
|
||||||
S_IN : textrec(f).mode:=fminput;
|
S_IN : textrec(f).mode:=fminput;
|
||||||
else
|
else
|
||||||
textrec(f).mode:=fmclosed;
|
textrec(f).mode:=fmclosed;
|
||||||
@ -114,7 +114,7 @@ begin
|
|||||||
DoAccept:=Accept(Sock,Addr,AddrLen);
|
DoAccept:=Accept(Sock,Addr,AddrLen);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function DoConnect(Sock:longint;const addr: TInetSockAddr): Longint;
|
Function DoConnect(Sock:longint;const addr: TInetSockAddr): Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
DoConnect:=Connect(Sock,Addr,SizeOF(TInetSockAddr));
|
DoConnect:=Connect(Sock,Addr,SizeOF(TInetSockAddr));
|
||||||
@ -122,32 +122,18 @@ end;
|
|||||||
|
|
||||||
Function Connect(Sock:longint;const addr: TInetSockAddr;var SockIn,SockOut:text):Boolean;
|
Function Connect(Sock:longint;const addr: TInetSockAddr;var SockIn,SockOut:text):Boolean;
|
||||||
|
|
||||||
Var FD : Longint;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FD:=DoConnect(Sock,addr);
|
Connect:=DoConnect(Sock,addr);
|
||||||
If Not(FD=-1) then
|
If Connect then
|
||||||
begin
|
Sock2Text(Sock,SockIn,SockOut);
|
||||||
Sock2Text(FD,SockIn,SockOut);
|
|
||||||
Connect:=true;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Connect:=false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:file):Boolean;
|
Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:file):Boolean;
|
||||||
|
|
||||||
Var FD : Longint;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FD:=DoConnect(Sock,addr);
|
Connect:=DoConnect(Sock,addr);
|
||||||
If Not (FD=-1) then
|
If Connect then
|
||||||
begin
|
Sock2File(Sock,SockIn,SockOut);
|
||||||
Sock2File(FD,SockIn,SockOut);
|
|
||||||
Connect:=true;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Connect:=false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function Accept(Sock:longint;var addr:TInetSockAddr;var SockIn,SockOut:text):Boolean;
|
Function Accept(Sock:longint;var addr:TInetSockAddr;var SockIn,SockOut:text):Boolean;
|
||||||
@ -179,7 +165,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ files created by splitting the linux sockets unit
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ Function Recv(Sock:Longint;Var Addr;AddrLen,Flags:Longint):Longint;
|
|||||||
Function Bind(Sock:Longint;Var Addr;AddrLen:Longint):Boolean;
|
Function Bind(Sock:Longint;Var Addr;AddrLen:Longint):Boolean;
|
||||||
Function Listen (Sock,MaxConnect:Longint):Boolean;
|
Function Listen (Sock,MaxConnect:Longint):Boolean;
|
||||||
Function Accept(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
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 Shutdown(Sock:Longint;How:Longint):Longint;
|
||||||
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||||
Function GetPeerName(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$
|
$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
|
+ files created by splitting the linux sockets unit
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -167,12 +167,10 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Longint;
|
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint): boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Connect:=SocketCall(Socket_Sys_Connect,Sock,longint(@Addr),AddrLen);
|
Connect:=SocketCall(Socket_Sys_Connect,Sock,longint(@Addr),AddrLen)=0;
|
||||||
If Connect<0 Then
|
|
||||||
Connect:=-1;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -255,7 +253,7 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function DoConnect(Sock:longint;const addr:string):Longint;
|
Function DoConnect(Sock:longint;const addr:string):Boolean;
|
||||||
var
|
var
|
||||||
UnixAddr : TUnixSockAddr;
|
UnixAddr : TUnixSockAddr;
|
||||||
AddrLen : longint;
|
AddrLen : longint;
|
||||||
@ -301,31 +299,19 @@ Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:text):Boolean
|
|||||||
Var FD : Longint;
|
Var FD : Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FD:=DoConnect(Sock,addr);
|
Connect:=DoConnect(Sock,addr);
|
||||||
If Not(FD=-1) then
|
If Connect then
|
||||||
begin
|
|
||||||
Sock2Text(Sock,SockIn,SockOut);
|
Sock2Text(Sock,SockIn,SockOut);
|
||||||
Connect:=true;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Connect:=false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:file):Boolean;
|
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:file):Boolean;
|
||||||
|
|
||||||
Var FD : Longint;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FD:=DoConnect(Sock,addr);
|
Connect:=DoConnect(Sock,addr);
|
||||||
if Not(FD=-1) then
|
if Connect then
|
||||||
begin
|
|
||||||
Sock2File(Sock,SockIn,SockOut);
|
Sock2File(Sock,SockIn,SockOut);
|
||||||
Connect:=true;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Connect:=false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$i sockets.inc}
|
{$i sockets.inc}
|
||||||
@ -334,7 +320,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ Updated to Florians system independent sockets unit
|
||||||
|
|
||||||
Revision 1.7 1999/06/08 18:35:24 michael
|
Revision 1.7 1999/06/08 18:35:24 michael
|
||||||
|
@ -109,11 +109,11 @@ begin
|
|||||||
SocketError:=0;
|
SocketError:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Longint;
|
Function Connect(Sock:Longint;Var Addr;Addrlen:Longint):Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Connect:=WinSock.Connect(Sock,WinSock.TSockAddr(Addr),AddrLen);
|
Connect:=WinSock.Connect(Sock,WinSock.TSockAddr(Addr),AddrLen)=0;
|
||||||
if Connect<0 then
|
if Connect then
|
||||||
SocketError:=WSAGetLastError
|
SocketError:=WSAGetLastError
|
||||||
else
|
else
|
||||||
SocketError:=0;
|
SocketError:=0;
|
||||||
@ -211,7 +211,10 @@ finalization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ initial revision, derieved from the linux version
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user