Fawkes API  Fawkes Development Version
client_handler.cpp
1 
2 /***************************************************************************
3  * client_handler.cpp - handle incoming msgs from FawkesNetworkClientThread
4  *
5  * Created: Thu Jun 14 17:18:39 2007
6  * Copyright 2006-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 #include <netcomm/fawkes/client_handler.h>
25 
26 namespace fawkes {
27 
28 /** @class FawkesNetworkClientHandler <netcomm/fawkes/client_handler.h>
29  * Message handler for FawkesNetworkClient.
30  * This interface is used by the FawkesNetworkClient to handle incoming messages.
31  * @ingroup NetComm
32  * @author Tim Niemueller
33  *
34  * @fn virtual void FawkesNetworkClientHandler::deregistered(unsigned int id) throw() = 0
35  * This handler has been deregistered.
36  * This is called when this handler is deregistered from the
37  * FawkesNetworkClient. Sometimes you may not want to allow this and post
38  * a big fat warning into the log.
39  * @param id the id of the calling client
40  *
41  * @fn virtual void FawkesNetworkClientHandler::inbound_received(FawkesNetworkMessage *m, unsigned int id) throw() = 0
42  * Called for incoming messages.
43  * This is called when an incoming message has been received. If this
44  * method was called one or more times then the a previously carried out
45  * wait(cid) call will continue.
46  * @param m Message to handle
47  * @param id the id of the calling client
48  *
49  * @fn virtual void FawkesNetworkClientHandler::connection_established(unsigned int id) throw() = 0
50  * Client has established a connection.
51  * Whenever the client establishes a connection this is signaled to handlers with this
52  * method. You can register to a client at any time, you may even enqueue messages to
53  * a client while the connection is dead. If the client at some point gets connected
54  * again, the messages will then be send out in one go. You should use this in your
55  * application though to only send data if the connection is alive and you should let
56  * the user know about the connection status.
57  * @param id the id of the calling client
58  *
59  * @fn virtual void FawkesNetworkClientHandler::connection_died(unsigned int id) throw() = 0
60  * Client connection died.
61  * This method is used to inform handlers that the connection has died for any reason.
62  * No more data can be send and no more messages should be enqueued because it is unclear
63  * when they would be sent.
64  * @param id the id of the calling client
65  *
66  */
67 
68 /** Empty virtual destructor. */
70 {
71 }
72 
73 } // end namespace fawkes
Fawkes library namespace.
virtual ~FawkesNetworkClientHandler()
Empty virtual destructor.