isockcli.pp 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Program Client;
  2. {
  3. This file is part of the Free Component Library (FCL)
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {
  12. TInetSocket client program. Before running this, run either
  13. 'isocksvr' or 'dsocksvr -i' in another terminal or in the
  14. background.
  15. }
  16. {$mode objfpc}{$H+}
  17. uses ssockets;
  18. Const
  19. TheHost = 'localhost';
  20. ThePort = 4100;
  21. var
  22. S : String;
  23. i : longint;
  24. begin
  25. S:='This is a textstring sent by the client'#10;
  26. With TInetSocket.Create(TheHost,ThePort) do
  27. begin
  28. For I:=1 to 10 do
  29. Write(S[1],Length(S));
  30. S:='QUIT'#10;
  31. Write(S[1],Length(S));
  32. Free;
  33. end;
  34. end.