15 #ifndef NYMPH_REMOTE_CLIENT_H
16 #define NYMPH_REMOTE_CLIENT_H
23 #include <Poco/Mutex.h>
24 #include <Poco/Net/SocketAddress.h>
25 #include <Poco/Net/StreamSocket.h>
27 #include "nymph_method.h"
28 #include "nymph_listener.h"
29 #include "nymph_logger.h"
30 #include "nymph_session.h"
34 static Poco::Mutex methodsMutex;
35 static Poco::Mutex callbacksMutex;
36 static Poco::Mutex sessionsMutex;
37 static std::map<int, NymphSession*> sessions;
39 static std::string loggerName;
41 static std::string serializedMethods;
42 static uint32_t nextMethodId;
44 static std::map<std::string, NymphMethod>& callbacks();
45 static std::map<std::string, NymphMethod>& methods();
46 static std::map<uint32_t, NymphMethod*>& methodsIds();
51 static bool init(logFnc logger,
int level = NYMPH_LOG_LEVEL_TRACE,
long timeout = 3000);
52 static void setLogger(logFnc logger,
int level);
53 static bool start(
int port = 4004);
54 static bool shutdown();
55 static bool registerMethod(std::string name,
NymphMethod method);
57 static bool removeMethod(std::string name);
59 static bool registerCallback(std::string name,
NymphMethod method);
60 static bool callCallback(
int handle, std::string name,
61 std::vector<NymphType*> &values, std::string &result);
62 static bool removeCallback(std::string name);
64 static bool addSession(
int handle,
NymphSession* session);
65 static bool removeSession(
int handle);
Definition: nymph_message.h:38
Definition: nymph_method.h:40
Definition: remote_client.h:33
Definition: nymph_session.h:26