24 #ifndef __NETCOMM_FAWKES_CLIENT_H_ 25 #define __NETCOMM_FAWKES_CLIENT_H_ 27 #include <netcomm/fawkes/message_queue.h> 28 #include <netcomm/fawkes/message.h> 29 #include <netcomm/fawkes/component_ids.h> 31 #include <core/exception.h> 32 #include <core/utils/lock_map.h> 33 #include <sys/socket.h> 40 class FawkesNetworkClientHandler;
41 class FawkesNetworkClientSendThread;
42 class FawkesNetworkClientRecvThread;
50 #define FAWKES_TCP_PORT 1910 60 unsigned short int port);
65 void connect(
const char *host,
unsigned short int port);
66 void connect(
const char *hostname,
const struct sockaddr *addr, socklen_t addrlen);
67 void connect(
const char *hostname,
const struct sockaddr_storage &addr);
72 void wait(
unsigned int component_id,
unsigned int timeout_sec = 15);
73 void wake(
unsigned int component_id);
75 void interrupt_connect();
78 void deregister_handler(
unsigned int component_id);
80 bool connected()
const throw();
83 unsigned int id()
const;
85 const char *get_hostname()
const;
89 void notify_of_connection_established();
90 void notify_of_connection_dead();
92 void wake_handlers(
unsigned int cid);
94 void connection_died();
95 void set_send_slave_alive();
96 void set_recv_slave_alive();
99 unsigned short int __port;
107 Mutex *__connest_mutex;
109 bool __connest_interrupted;
113 std::map<unsigned int, bool> __recv_received;
116 bool __recv_slave_alive;
117 bool __send_slave_alive;
119 bool connection_died_recently;
120 Mutex *slave_status_mutex;
124 struct sockaddr *addr_;
Message handler for FawkesNetworkClient.
Wait until a given condition holds.
Simple Fawkes network client.
Fawkes library namespace.
Representation of a message that is sent over the network.
Fawkes network client send thread.
TCP stream socket over IP.
HandlerAlreadyRegisteredException()
Costructor.
Base class for exceptions in Fawkes.
Client handler has already been registered.
Mutex mutual exclusion lock.
Fawkes network client receive thread.