tclientsocket: errorcode:=0;

when i trie to connect to a non existting ip i still get the errormessage: on api asysinc lookup: i have an on error event in my clientsocket witch setst errorcode:= 0

{source}
var
Form1: TForm1;
scanbegin:integer;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
scanbegin:=strtoint(edit4.text);
scan;
end;
procedure tform1.scan;
begin
scanner.active:=false;
inc(scanbegin);
if scanbegin<strtoint(edit8.text) then begin
scanner.host:= edit1.text+edit2.text+edit3.text+inttostr(scanbegin);
scanner.active:=true;
end
else
begin
scanner.active:=false;
memo1.lines .add('scanning complete..');
end;
end;
procedure TForm1.scannerError(Sender: TObject; Socket: TCustomWinSocket;
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin

errorcode:=0;
memo1.lines.add(edit1.text+edit2.text+edit3.text+ inttostr(scanbegin)+ 'has no pub on port 21');
scan;
end;

procedure TForm1.scannerConnect(Sender: TObject; Socket: TCustomWinSocket);
begin
memo1.lines.add(edit1.text+edit2.text+edit3.text+ inttostr(scanbegin)+'is an open pub');
scan;
end;

procedure TForm1.scannerRead(Sender: TObject; Socket: TCustomWinSocket);
begin

memo2.lines.add(inttostr(scanbegin)+socket.receivetext);

end;

end.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories