source: BAORadio/libindi/libindi/BAOTest/simple_server_main.cpp @ 501

Last change on this file since 501 was 501, checked in by frichard, 14 years ago

-BAOControl : petite interface permettant de contrôler les antennes via le pilote indi_BAO
-Le pilote indi_BAO utilise désormais libindi v 0.7

File size: 642 bytes
Line 
1#include "ServerSocket.h"
2#include "SocketException.h"
3#include <string>
4
5int main ( int argc, int argv[] )
6{
7  std::cout << "running....\n";
8
9  try
10    {
11      // Create the socket
12      ServerSocket server ( 7624 );
13
14      while ( true )
15        {
16
17          ServerSocket new_sock;
18          server.accept ( new_sock );
19
20          try
21            {
22              while ( true )
23                {
24                  std::string data;
25                  new_sock >> data;
26                  std::cout << data << "\n";
27                  new_sock << "du serveur\n";
28                }
29            }
30          catch ( SocketException& ) {}
31
32        }
33    }
34  catch ( SocketException& e )
35    {
36      std::cout << "Exception was caught:" << e.description() << "\nExiting.\n";
37    }
38
39  return 0;
40}
Note: See TracBrowser for help on using the repository browser.