2
0

sockcli.pp 1018 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. TUnixSocket client program. Before running this, run either
  13. 'socksvr', or 'dsocksvr' in another terminal
  14. or in the background.
  15. }
  16. {$ifndef unix}
  17. {$fatal This test is only for Unix platforms}
  18. {$endif}
  19. {$mode objfpc}{$H+}
  20. uses ssockets;
  21. var
  22. S : String;
  23. i : longint;
  24. begin
  25. S:='This is a textstring sent by the client'#10;
  26. With TUnixSocket.Create('ServerSoc') 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.