Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : IdMappedPortTCP Error. Help with Debug Code please
| Subject: | IdMappedPortTCP Error. Help with Debug Code please |
| Posted by: | "Danny Kellett" (dkelle..@gotadsl.co.uk) |
| Date: | Wed, 26 Apr 2006 21:08:00 |
Im getting
On Outbound connect. Access violation at address 00471D1B in module
'Project1.exe'. Read of address 00000004
Im new to this. Please can anyone provide a way of debugging this please?
What Code do I need to check what is missing or wrong
Nothing special in the code just dont know why. I can telnet to the IP and
port fine.
Thanks
CODE
procedure TForm1.Button1Click(Sender: TObject);
begin
IdMappedPortTCP1.Active := True;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IdMappedPortTCP1.Active := FALSE;
end;
procedure TForm1.IdMappedPortTCP1Connect(AContext: TIdContext);
begin
Log('Incoming Connection'); // When the client connects to the mapper
// AContext.Connection.Socket
end;
procedure TForm1.IdMappedPortTCP1Exception(AContext: TIdContext;
AException: Exception);
begin
Log('Exception: ' + AException.Message);
end;
procedure TForm1.IdMappedPortTCP1Execute(AContext: TIdContext);
begin
Log('On Execute');
end;
procedure TForm1.IdMappedPortTCP1OutboundConnect(AContext: TIdContext;
AException: Exception);
begin
Log('On Outbound connect. ' + AException.Message); // When the mapper tries
//conect to the server
end;
procedure TForm1.Log(S: String);
begin
Memo1.Lines.Add(S);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if IdMappedPortTCP1.Active then
form1.Caption := 'Active'
else
form1.Caption := 'Not Active';
end;