PDA

View Full Version : Socket Error



Runaway
03-20-2011, 07:01 PM
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.

http://img59.imageshack.us/img59/4179/socketerror.png (http://img59.imageshack.us/i/socketerror.png/)

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?
04-07-2011, 07:25 PM
Are you using Lazarus?

Runaway
04-07-2011, 10:04 PM
I used Delphi 7 for this one.