1 /**************************************************************************
2 ** (c) Copyright 2012, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
6 ** FILE NAME : intest.cpp
7 ** SYSTEM NAME : Network and socket classes - test routine
8 ** VERSION NUMBER : 0.1
10 ** DESCRIPTION : Input stream test.
11 ** Connects to TCP port 1234 and reads a line.
12 ** Test with: echo "this is a test"|nc -l 1234
17 ***************************************************************************
18 ** ADMINISTRATIVE INFORMATION *
19 ********************************
20 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
21 ** CREATION DATE : Oct 19, 2012
22 ** LAST UPDATE : Oct 29, 2012
24 **************************************************************************/
26 #include "sockstream.h"
29 /*=========================================================================
33 ** RETURN VALUE : None
35 ** DESCRIPTION : Read lines of text from port 1234 and echo these lines
42 ** LAST MODIFIED : Oct 29, 2012
43 **=========================================================================
48 IPSocketAddress serveraddress(InternetAddress("127.0.0.1"), Port(1234));
52 s.Connect(serveraddress);
53 isockstream reader(s);
58 std::cout << buf << "\n";