[delphi][center]
für remoteServer folgender Code
function _CheckCon(const
IP:string):boolean;
var
ClientSocket : TSocket;
Name : TSockAddr;
WSData : TWSAData;
begin
result:=false;
WSAStartup($0101,WSData); // WinSock v1.1
ClientSocket := WinSock.Socket(PF_INET,sock_Stream,IPPROTO_IP);
if (ClientSocket <> Invalid_Socket) then begin
with Name do begin
sin_Family := PF_INET;
sin_Port := htons(139); // die Portnummer des Servers
sin_Addr := TInAddr(Inet_Addr(PChar(
IP))); // inet_addr in in_addr umwandeln
end;
result:=(Connect(ClientSocket,Name,SizeOf(Name))<> Socket_Error); // connection zum Server aufbauen
end;
CloseSocket(ClientSocket);
WSACleanup;
end;