[DEV] correct connection first message
This commit is contained in:
parent
50544c3704
commit
2978045244
@ -19,13 +19,14 @@ jus::GateWayClient::GateWayClient(enet::Tcp _connection, jus::GateWay* _gatewayI
|
||||
|
||||
jus::GateWayClient::~GateWayClient() {
|
||||
JUS_TODO("Call All unlink ...");
|
||||
|
||||
}
|
||||
|
||||
void jus::GateWayClient::start(size_t _uid) {
|
||||
m_uid = _uid;
|
||||
m_dataCallback = m_interfaceClient.signalData.connect(this, &jus::GateWayClient::onClientData);
|
||||
m_interfaceClient.connect(true);
|
||||
m_interfaceClient.setInterfaceName("cli-" + etk::to_string(m_uid));
|
||||
m_dataCallback = m_interfaceClient.signalData.connect(this, &jus::GateWayClient::onClientData);
|
||||
}
|
||||
|
||||
void jus::GateWayClient::stop() {
|
||||
|
@ -20,9 +20,9 @@ jus::GateWayService::~GateWayService() {
|
||||
}
|
||||
|
||||
void jus::GateWayService::start() {
|
||||
m_dataCallback = m_interfaceClient.signalData.connect(this, &jus::GateWayService::onServiceData);
|
||||
m_interfaceClient.connect();
|
||||
m_interfaceClient.setInterfaceName("srv-?");
|
||||
m_dataCallback = m_interfaceClient.signalData.connect(this, &jus::GateWayService::onServiceData);
|
||||
}
|
||||
|
||||
void jus::GateWayService::stop() {
|
||||
|
@ -7,6 +7,21 @@
|
||||
#include <jus/ParamType.h>
|
||||
#include <jus/debug.h>
|
||||
|
||||
|
||||
jus::ParamType::ParamType(const char* _name):
|
||||
m_typeName(_name) {
|
||||
|
||||
}
|
||||
|
||||
const char* jus::ParamType::getName() const {
|
||||
return m_typeName;
|
||||
}
|
||||
|
||||
bool jus::ParamType::operator == (const ParamType& _obj) const {
|
||||
return m_typeName == _obj.m_typeName;
|
||||
}
|
||||
|
||||
|
||||
#define generate_basic_type(_type, _name) \
|
||||
template<> ParamType createType<_type>() {\
|
||||
return ParamType(_name); \
|
||||
|
@ -9,16 +9,9 @@ class ParamType {
|
||||
protected:
|
||||
const char* m_typeName;
|
||||
public:
|
||||
ParamType(const char* _name = ""):
|
||||
m_typeName(_name) {
|
||||
|
||||
}
|
||||
const char* getName() const {
|
||||
return m_typeName;
|
||||
}
|
||||
bool operator == (const ParamType& _obj) const {
|
||||
return m_typeName == _obj.m_typeName;
|
||||
}
|
||||
ParamType(const char* _name = "");
|
||||
const char* getName() const;
|
||||
bool operator == (const ParamType& _obj) const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -16,8 +16,7 @@
|
||||
|
||||
jus::Service::Service() :
|
||||
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &jus::Service::onPropertyChangeIp),
|
||||
propertyPort(this, "port", 1982, "Port to connect server", &jus::Service::onPropertyChangePort),
|
||||
m_id(0) {
|
||||
propertyPort(this, "port", 1982, "Port to connect server", &jus::Service::onPropertyChangePort) {
|
||||
m_dataCallback = m_interfaceClient.signalData.connect(this, &jus::Service::onClientData);
|
||||
}
|
||||
|
||||
|
@ -12,27 +12,6 @@
|
||||
#include <jus/AbstractFunctionTypeClass.h>
|
||||
#include <jus/debug.h>
|
||||
|
||||
static double mulllll(double _val1) {
|
||||
double _val2 = 2.0f;
|
||||
JUS_ERROR("Call with parameter : " << _val1);
|
||||
return _val1*_val2;
|
||||
}
|
||||
|
||||
static void mulllll2(std::string _value, int32_t _val1) {
|
||||
JUS_ERROR("Call with parameter : " << _value);
|
||||
JUS_ERROR(" parameter : " << _val1);
|
||||
}
|
||||
|
||||
static std::string mulllll3(float _value, bool _val1) {
|
||||
JUS_ERROR("Call with parameter : " << _value);
|
||||
JUS_ERROR(" parameter : " << _val1);
|
||||
double _val2 = 1.0f;
|
||||
return "'il fait beau aujoud'hui ...'";
|
||||
}
|
||||
|
||||
static bool mulllll4() {
|
||||
return false;
|
||||
}
|
||||
namespace jus {
|
||||
class Service : public eproperty::Interface {
|
||||
public:
|
||||
@ -63,34 +42,7 @@ namespace jus {
|
||||
void advertise(const std::string& _name,
|
||||
JUS_RETURN_VALUE (*_func)(JUS_FUNC_ARGS_TYPE... _args),
|
||||
const std::string& _desc) {
|
||||
//AbstractFunction* tmp = createAbstractFunctionDirect(_name, &mulllll);
|
||||
AbstractFunction* tmp = createAbstractFunctionDirect(_name, "desc", &mulllll);
|
||||
JUS_ERROR("Signature : " << tmp->getPrototype());
|
||||
{
|
||||
ejson::Array param;
|
||||
param.add(ejson::Number(58.5));
|
||||
ejson::Value out = tmp->executeJson(param);
|
||||
JUS_ERROR(" return: ");
|
||||
out.display();
|
||||
}
|
||||
|
||||
|
||||
tmp = createAbstractFunctionDirect(_name, "desc", &mulllll2);
|
||||
JUS_ERROR("Signature2 : " << tmp->getPrototype());
|
||||
{
|
||||
ejson::Array param;
|
||||
param.add(ejson::String("coucou"));
|
||||
param.add(ejson::Number(1563));
|
||||
ejson::Value out = tmp->executeJson(param);
|
||||
JUS_ERROR(" return: ");
|
||||
out.display();
|
||||
}
|
||||
tmp = createAbstractFunctionDirect(_name, "desc", &mulllll3);
|
||||
JUS_ERROR("Signature3 : " << tmp->getPrototype());
|
||||
JUS_ERROR(" return: " << tmp->executeString(etk::split("3.5 false", ' ')));
|
||||
|
||||
tmp = createAbstractFunctionDirect(_name, "desc", &mulllll4);
|
||||
JUS_ERROR("Signature4 : " << tmp->getPrototype());
|
||||
AbstractFunction* tmp = createAbstractFunctionDirect(_name, _desc, _func);
|
||||
}
|
||||
/**
|
||||
* @brief A extern client connect on specific user
|
||||
|
Loading…
x
Reference in New Issue
Block a user