Re: connect to a remote host in delphi


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]

Posted by Shorty on January 03, 2002 at 10:17:35:

In Reply to: connect to a remote host in delphi posted by Stephen Isaac on November 20, 2001 at 17:52:33:

u need a ClientSocket and make the properties of it
with ClientSocket1 do
Host := Edit1.Text; // somemachine.reading.ac.uk
Port := StrToInt(Edit2.Text); // 4999
end;

and to send text over the connection use
ClientSocket1.Socket.SendText('...');
and prepend a CRLF if u need to (#13#10)
eg. ClientSocket1.Socket.SendText(Text + #13#10);
and to read what the server has sent to you use in the OnRead event handeler for the socket:
Memo1.Lines.Add(Socket.ReceiveText);
or put it as some other string, and you will have to build on that or u could email me for more help cos i dont know the protocol that the server uses.

 

Related Articles and Replies


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]