Accept Example for Delphi
procedure TForm1.LEADDicomNet1NetAccept(ASender: TObject;
nStatus: Integer);
var
strOut: String;
hClient: LongInt;
nClients: LongInt;
begin
//accepting the connection attempt
LEADDICOMNet1.Accept();
//get the latest client
nClients:= LEADDICOMNet1.GetClientCount (LEADDICOMNet1.hNet);
hClient:= LEADDICOMNet1.GetClient (LEADDICOMNet1.hNet, nClients - 1);
//display some information about the connection:
strOut:= 'Connection Accepted - ' + 'Peer: ' + LEADDICOMNet1.GetPeerAddress (hClient);
Memo1.Lines.Add(strOut);
//reject the connection if we don//t like the address
if(LEADDICOMNet1.GetPeerAddress (hClient) <> '207.238.49.199')then
begin
//close the connection
LEADDICOMNet1.Close(hClient);
end;
end;