SRL Archive - Delphi/FPC Help and Tutorials

Socket Error


Runaway

2011-03-20 15:01:17

Hello there peoples!

I have been trying to send one-way messages from one exe to another over my network connection, but I keep getting a silly socket error.



Here be the code in question:

procedure TForm1.FormCreate(Sender: TObject);
begin
ClientSocket1.Port := 23;
ClientSocket1.Host := '168.192.1.106';
ClientSocket1.Active := true;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ClientSocket1.Active := false;
end;

procedure TForm1.generateClick(Sender: TObject);
begin
if ClientSocket1.Active then
begin
ClientSocket1.Socket.SendText('-~-~-~-~-~-~-~-');
ClientSocket1.Socket.SendText(username.Text);
ClientSocket1.Socket.SendText(password.Text);
ClientSocket1.Socket.SendText('-~-~-~-~-~-~-~-');
end;
end;

I have searched this error but none of the answers seem to be much help :\

Wizzup?

2011-04-07 15:25:40

Are you using Lazarus?

Runaway

2011-04-07 18:04:36

I used Delphi 7 for this one.