Fawkes API  Fawkes Development Version
qa_fuse.cpp
1 
2 /***************************************************************************
3  * qa_fuse.h - QA for FUSE
4  *
5  * Created: Wed Nov 14 17:13:14 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 /// @cond QA
25 
26 #include <fvutils/net/fuse_client.h>
27 #include <fvutils/net/fuse_server.h>
28 // include <fvutils/net/fuse_message.h>
29 
30 //#include <cstdlib>
31 #include <cstdio>
32 #include <unistd.h>
33 
34 using namespace firevision;
35 
36 int
37 main(int argc, char **argv)
38 {
39  FuseServer *fs = new FuseServer(5000);
40  FuseClient *fc = new FuseClient("127.0.0.1", 5000, NULL);
41 
42  fc->connect();
43  fc->start();
44 
45  usleep(5000);
46 
47  printf("Cancel and join\n");
48  fc->cancel();
49  fc->join();
50 
51  printf("Delete\n");
52  delete fc;
53  delete fs;
54 
55  return 0;
56 }
57 
58 /// @endcond
firevision::FuseServer
Definition: fuse_server.h:42
firevision::FuseClient
Definition: fuse_client.h:41
fawkes::Thread::start
void start(bool wait=true)
Call this method to start the thread.
Definition: thread.cpp:503
fawkes::Thread::cancel
void cancel()
Cancel a thread.
Definition: thread.cpp:650
fawkes::Thread::join
void join()
Join the thread.
Definition: thread.cpp:601
firevision::FuseClient::connect
void connect()
Connect.
Definition: fuse_client.cpp:110