Giter VIP home page Giter VIP logo

libpomelo2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libpomelo2's Issues

ignoring route in response is WRONG!

If libpomelo2 gets a response in protobuf format, it will fail!

https://github.com/NetEase/libpomelo2/blob/master/src/tr/uv/pr_msg.c#L202
Here we will set msg.route = NULL when PC_MSG_HAS_ROUTE returns false, for PC_MSG_RESPONSE == raw_msg->type

So response message will only go into json decode here, https://github.com/NetEase/libpomelo2/blob/master/src/tr/uv/pr_msg.c#L217 , since it doesn't have any route information.

libpomelo has solved this problem by seeking corresponding request route:
https://github.com/NetEase/libpomelo/blob/master/src/protocol.c#L134

I tried to fix but it will modify the code framework a lot...I wonder whether there is any better solution

libpomelo2.so for android can't connect to latest chatofpomelo server

I tried building libpomelo2.so (version 0.2.0) on both ubuntu 14.04 32-bit and 64-bit, "file libpomelo2.so" shows :
libjpomelo.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped

When I tried to test it on android, it shows: (I was using Test.java in the libpomelo2 source code, IP is changed to IP of my local machine)

04-02 05:51:17.798: I/System.out(703): UV Conn Error get push message: null
04-02 05:51:17.807: I/System.out(703): ev_type: PC_EV_CONNECT_ERROR
04-02 05:51:18.787: I/System.out(703): UV Conn Error get push message: null
04-02 05:51:18.807: I/System.out(703): ev_type: PC_EV_CONNECT_ERROR
04-02 05:51:18.818: I/System.out(703): get resp:null
04-02 05:51:23.818: I/System.out(703): UV Conn Error get push message: null
04-02 05:51:23.818: I/System.out(703): ev_type: PC_EV_CONNECT_ERROR
04-02 05:51:34.808: I/System.out(703): UV Conn Error get push message: null
04-02 05:51:34.808: I/System.out(703): ev_type: PC_EV_CONNECT_ERROR

字符集和字符编码问题

因为我这边UI到客户端上层的出口和客户端上层到UI的出口都是GBK的字符集 可是libpoemlo2底层又不支持GBK的字符集 所以我在递给libpoemlo2的时候 就转成了unicode(eg:"\u1234"),然后libpoemlo2底层又转一次(还是unicode,叫它"naxx"吧)然后发给服务器,服务器内部是可以正常显示汉字了,可是在libpoemlo2的recieved里decode的时候没有给我转回成我之前递给他unicode(eg:"\u1234"),而是"naxx",这个时候我再递给我的中间层unicode转GBK的时候 就是乱码了,理论上讲这个过程应该是对称的才对呀

android,a new compile bug for libpomelo2

CC(target) out/Default/obj.target/libuv/deps/uv/src/unix/android-ifaddrs.o
deps/uv/src/unix/android-ifaddrs.c: In function ‘calcAddrLen’:
deps/uv/src/unix/android-ifaddrs.c:270:35: error: invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr_ll’
deps/uv/src/unix/android-ifaddrs.c:270:42: warning: implicit declaration of function ‘offsetof’ [-Wimplicit-function-declaration]
deps/uv/src/unix/android-ifaddrs.c:270:65: error: expected expression before ‘struct’
deps/uv/src/unix/android-ifaddrs.c:272:62: error: expected expression before ‘struct’
deps/uv/src/unix/android-ifaddrs.c: In function ‘makeSockaddr’:
deps/uv/src/unix/android-ifaddrs.c:287:49: error: dereferencing pointer to incomplete type
deps/uv/src/unix/android-ifaddrs.c:288:42: error: dereferencing pointer to incomplete type
deps/uv/src/unix/android-ifaddrs.c: In function ‘interpretLink’:
deps/uv/src/unix/android-ifaddrs.c:383:47: error: dereferencing pointer to incomplete type
deps/uv/src/unix/android-ifaddrs.c:384:47: error: dereferencing pointer to incomplete type
deps/uv/src/unix/android-ifaddrs.c: In function ‘interpretAddr’:
deps/uv/src/unix/android-ifaddrs.c:565:13: warning: overflow in implicit constant conversion [-Woverflow]
deps/uv/src/unix/android-ifaddrs.c: In function ‘calcAddrLen’:
deps/uv/src/unix/android-ifaddrs.c:274:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [out/Default/obj.target/libuv/deps/uv/src/unix/android-ifaddrs.o] Error 1
root@iZ23p8bfdl5Z:/usr/local/src/libpomelo2-master#

Building libpomelo2 unity client?

Hello,

First off -- thanks for the great project :) Loving it so far.

I am on OS X and I have followed your steps to build the unity client. So far I have made the xcode proj using command:

gyp --depth=. pomelo.gyp -Duse_sys_openssl=false -Dbuild_cspomelo=true -f xcode

I am able to build in xcode but do not know what should be output and where to proceed from here.

Thank you.

不能正确处理Protobuf的请求

你好,

如果Server启动Protobuf,并且定义了serverProtos.json,libPomelo2将无法解码。

跟了一下代码,发现pc_default_msg_decode中,msg.route没有办法获得,因为从Server回来的消息这个字段是没有的。

比对了JS的实现如下,
if(msg.id > 0){ msg.route = routeMap[msg.id]; delete routeMap[msg.id]; if(!msg.route){ return; } }
JS客户端回在请求发起前把request ID和route的关系存在一个map里面,回头收到响应的时候通过查这个表得到route,但是libpomelo2没有这个步骤,所以怀疑问题出在这儿,我自己看了一下,因为对代码不了解,还不知道该如何修改,请帮忙修复这个BUG,谢谢

libpomelo2在android上的编译问题.

你好, 我编译的android使用的so文件,在android5上运行没问题,但是在4.0的机型上初始化的是就报错

java.lang.UnsatisfiedLinkError: 
dlopen failed: cannot locate symbol "srand" referenced by "libpomelo.so".

我的NDK用的是10e,后来又换了9d,问题依然.

请问下是不是我修改了 Android.mk文件?
之所以修改是因为用git上的根本编译不能通过,很多依赖都找不到.后来用排除法将所有没有的依赖删除后才编译成功.
下面是我修改后的 Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := pomelo_static

LOCAL_MODULE_FILENAME := libpomelo

LOCAL_SRC_FILES := \
src/pc_JSON.c \
src/pc_lib.c \
src/pc_pomelo.c \
src/pc_trans.c \
src/pc_trans_repo.c \
src/tr/dummy/tr_dummy.c \
src/tr/uv/pb_decode.c \
src/tr/uv/pb_encode.c \
src/tr/uv/pb_i.c \
src/tr/uv/pr_msg.c \
src/tr/uv/pr_msg_json.c \
src/tr/uv/pr_msg_pb.c \
src/tr/uv/pr_pkg.c \
src/tr/uv/tr_uv_tcp.c \
src/tr/uv/tr_uv_tcp_aux.c \
src/tr/uv/tr_uv_tcp_i.c \
java/com_netease_pomelo_Client.c


LOCAL_CFLAGS := -DPC_NO_UV_TLS_TRANS



LOCAL_EXPORT_C_INCLUDES :=$(LOCAL_PATH)/include



LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
                    $(LOCAL_PATH)/src \
                    $(LOCAL_PATH)/src/tr/dummy \
                    $(LOCAL_PATH)/src/tr/uv

LOCAL_WHOLE_STATIC_LIBRARIES := uv_static jansson_static



include $(BUILD_STATIC_LIBRARY)

LOCAL_CFLAGS    := -D__ANDROID__ 

$(call import-module,libpomelo2/deps/uv) 

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yousi.sjtujj-1/base.apk"],nativeLibraryDirectories=[/data/app/com.yousi.sjtujj-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libjpomelo.so"

02-24 11:08:20.954 13812-13812/com.yousi.sjtujj E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.yousi.sjtujj, PID: 13812
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yousi.sjtujj-1/base.apk"],nativeLibraryDirectories=[/data/app/com.yousi.sjtujj-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libjpomelo.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.netease.pomelo.Client.(Client.java:80)
at com.yousi.sjtujj.ApplicationContext.onCreate(ApplicationContext.java:64)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4580)
at android.app.ActivityThread.access$1500(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5283)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

事件宏的时态不一致

  • PC_EV_CONNECTED: 过去时
  • PC_EV_DISCONNECT: 一般现在时
  • PC_EV_KICKED_BY_SERVER: 过去时

Nodejs 的 net.Socket 事件是用的一般现在时,比如 connect, close.

编译BUG

命令行:
./android-toolchain.sh /usr/ndk/android-ndk-r10 && ./android-gen.sh && make
提示:
In file included from java/com_netease_pomelo_Client.c:10:0:
java/com_netease_pomelo_Client.h:2:17: fatal error: jni.h: No such file or directory
compilation terminated.

什麼時候出lua的binding

希望官方能儘快出一個lua binding啊~
沒有lua和C#的binding 基本上大多數基於cocos2d-x lua和Unity3D的遊戲都不能用啊

例子链接错误:LINK : fatal error LNK1181: 无法打开输入文件“advapi32.obj”

编译环境:

windows 8.1
X64位
visual studio 2010 旗舰版 

编译选型:

gyp.bat --depth=. pomelo.gyp -Dtarget_arch
=ia32 -Dno_tls_support=true -Dbuild_pypomelo=false  -Dbuild_jpomelo=false

其中 ia32和x64,都试过,均链接失败

错误信息:

1>LINK : fatal error LNK1181: 无法打开输入文件“advapi32.obj”

这个问题大家遇到过吗?

a new bug

CC(target) out/Default/obj.target/jansson/deps/jansson/src/dump.o
make: arm-linux-androideabi-gcc: Command not found
make: *** [out/Default/obj.target/jansson/deps/jansson/src/dump.o] Error 127

error with gyp on mac OS X

gyp --depth=. pomelo.gyp -Duse_sys_openssl=true -f xcode -Dtarget_arch=x64

Traceback (most recent call last):
File "/usr/local/bin/gyp", line 9, in
load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/init.py", line 544, in script_main
return main(sys.argv[1:])
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/init.py", line 537, in main
return gyp_main(args)
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/init.py", line 522, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/generator/xcode.py", line 1196, in GenerateOutput
xct.FrameworksPhase().AddFile(library)
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/xcodeproj_file.py", line 1870, in AddFile
self.AppendBuildFile(pbxbuildfile, path)
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/xcodeproj_file.py", line 1851, in AppendBuildFile
self._AddBuildFileToDicts(pbxbuildfile, path)
File "/Library/Python/2.7/site-packages/gyp-0.1-py2.7.egg/gyp/xcodeproj_file.py", line 1841, in _AddBuildFileToDicts
xcfilelikeelement.Name()
ValueError: Found multiple build files for -lssl

jansson解析json的问题

json是这样的

{"rid":"1","body":"Hello from lua's request","username":"Jennal's"}

然后输出错误

[2014-12-25 12:54:18][ERROR] pc_default_msg_encode - the msg is not invalid json, error: invalid 
escape near '"Hello from lua\''

不知道json应该如何写才正确?这段json是在lua里面encode的。不是通过jansson encode的。

Should C# plugin(win) be a single cspomelo.dll instead of two DLLs (cspomelo.dll and libpomelo2.dll) ?

I try to complie the unity plugin,and thought that a single cspomelo.dll maybe the common ways for unity plugins.
And in my vs2015, multiple DLLS way do not work yet
'''
gyp --depth=. pomelo.gyp -Dbuild_cspomelo=true -Dpomelo_library=shared_library
'''
failed with some link errors.

I thought the best command to indicate to generate a DLL for c# plugin should simply like this (and it generate a single dll )
'''
gyp --depth=. pomelo.gyp -Dbuild_cspomelo=true
'''
But there are some problems for me:VS-PRB: Can't Export from Static Libraries
To export functions to DLL from static library in VC .
It must ,either recomplie static library with __declspec(dllexport) for all the functions to be exported ,or write a handy .def files to export.

So how can i make gpy to generate the right sln automatically? i saw the pomelo.gyp file,but cause i did not know gyp before,so i have no clue.
(
Things i want to do is that
define BUILDING_PC_SHARED in project <libpomelo2> automatically
by command gyp --depth=. pomelo.gyp -Dbuild_cspomelo=true,
so the static library libpomelo2.lib will be compiled with __declspec(dllexport)
).

关于ios中的tls

在ios中发送给服务端的是明文?我的三个静态libpomelo2.a、libuv.a、libjansson.a是直接用xcode编译生成的。服务端说没有tls加密。请问我要怎么做?

android平台的mk什么时候出来了

最近需要用libpomelo,已经对libpomelo1做了封装了,但总觉得API缺乏,而且设计略显不合理,突然发现libpomelo2出来了,看了下接口比1要优秀好多,非常想转到2上来用,但是android得编译不知道什么时候能出来,我心堪忧啊。

pc_client_cleanup() inside pc_client_poll() bug.

If pc_client_cleanup() called inside pc_client_poll() will trigger assertion faild:

#3  0x00007fff840ecdf8 in __assert_rtn ()
#4  0x0000000101879cd7 in pc_mutex_destroy at deps/libpomelo2/src/pc_mutex.h:82
#5  0x0000000101879c11 in pc_client_cleanup at deps/libpomelo2/src/pc_pomelo.c:291
#6  0x00000001018abb72 in Client_gc(lua_State*) at lua-pomelo.cpp:465
#7  0x00000001017e8f28 in lj_BC_FUNCC ()
#8  0x00000001017eb366 in gc_finalize ()
#9  0x00000001017eb8ed in gc_onestep ()
#10 0x00000001017ebd48 in lj_gc_fullgc ()
#11 0x00000001017f9635 in lua_gc ()
#12 0x0000000101840ec7 in lj_cf_collectgarbage ()
#13 0x00000001017e8f28 in lj_BC_FUNCC ()
#14 0x00000001017f91f4 in lua_pcall ()
#15 0x00000001018abfc3 in lua_request_cb(pc_request_s const*, int, char const*) at lua-pomelo.cpp:559
#16 0x000000010187c560 in pc__trans_resp at deps/libpomelo2/src/pc_trans.c:333
#17 0x0000000101879dbc in pc__handle_event at deps/libpomelo2/src/pc_pomelo.c:310
#18 0x0000000101879447 in pc_client_poll at deps/libpomelo2/src/pc_pomelo.c:374

the pc_client_poll locks the event_mutex and pc_client_cleanup tries to destroy it.

The library neither checking polling states in pc_client_cleanup nor provide way to delay destroy client.

QT使用libpomelo2

[2014-09-16 18:15:54][INFO] tr_uv_tcp_thread_fn - start uv loop thread
[2014-09-16 18:15:54][INFO] pc_trans_fire_event - fire event: PC_EV_CONNECT_ERROR, arg1: UV Conn Error, arg2:
[2014-09-16 18:15:54][ERROR] tcp__conn_async_cb - uv tcp connect error: invalid argument, will reconn
[2014-09-16 18:15:54][DEBUG] tcp__reconn - reconnect, delay: 2

设置情况

client = (pc_client_t*)malloc(pc_client_size());
pc_client_config_t config = PC_CLIENT_CONFIG_DEFAULT;
pc_client_init(client,NULL,&config);
pc_client_connect(client, "127.0.0.1", 3010, NULL);

Problem about plugin_register

当多次调用 pc_lib_init(NULL, NULL, NULL, NULL); 时,pc_tran_repo.c 第 26 行会报读内存错

  if (plugin->on_register)
    plugin->on_register(plugin);

Assertion fail when connect and disconnect then cleanup without delay.

I'm running unit tests on my lua-pomelo got follow error:

Assertion failed: (client->state == PC_ST_CONNECTING || client->state == PC_ST_DISCONNECTING), function pc__trans_fire_event, file /Users/xpol/Workspace/lua-pomelo/deps/libpomelo2/src/pc_trans.c, line 111.

The equal c code is (the c code got same assertion error):

int runc()
{
    pc_client_t* client = (pc_client_t*)malloc(pc_client_size());
    pc_client_config_t config = PC_CLIENT_CONFIG_DEFAULT;
    pc_lib_init(NULL, NULL, NULL, "Test Client");
    pc_client_init(client, NULL, &config);
    pc_client_connect(client, "127.0.0.1", 3010, NULL);
    pc_client_disconnect(client);
    pc_client_cleanup(client);
    return 0;
}

When the follow code executes, the client->state is PC_ST_INITED (1).

function pc__trans_fire_event, file /Users/xpol/Workspace/lua-pomelo/deps/libpomelo2/src/pc_trans.c, line 111.

        case PC_EV_CONNECT_ERROR:
            assert(client->state == PC_ST_CONNECTING || client->state == PC_ST_DISCONNECTING); // <-- client->state is PC_ST_INITED (1)
            break;

NDK路径也设置了,报找不到JNI

In file included from java/com_netease_pomelo_Client.c:10:0:
java/com_netease_pomelo_Client.h:2:17: fatal error: jni.h: No such file or directory
compilation terminated.

实现gate客户端遇到的问题

我今天在做gate的客户端,流程是这样的

  1. 连接gate服务器
  2. 请求gate接口,得到新的IP和端口
  3. 断开gate服务器的连接,重新连接新的IP和端口

当我做第3步的时候,遇到了一些问题。
首先,我尝试

pc_client_disconnect(client);
pc_client_connect(client, new_host, new_port);

但是这样不行,connect的时候,提示状态不对,还没有disconnect成功。

第二个方案是在接收到PC_EV_DISCONNECT事件的时候再连接,但还是失败。
查找原因,由于我用的是poll机制,pc_client_connect中调用了pc_client_poll,而这个时候,pc_client_connect调用的堆栈是在pc__handle_event中的(接收到PC_EV_DISCONNECT事件的时候)。当前ev->queue的节点还没有被删除,所以又执行了一次pc__trans_fire_event,导致又发起了一次PC_EV_DISCONNECT事件,而这个时候client的状态已经不是PC_ST_DISCONNECTING,所以在pc_trans.c:120中的assert就过不去了。

这里有2个问题

  1. 我实现gate客户端的方法是否正确?
  2. pc__handle_event的机制是否有问题?删除事件节点是否应该在回调之前,以此来避免一些死循环?
static void pc__handle_event(pc_client_t* client, pc_event_t* ev)
{
    assert(PC_EV_IS_RESP(ev->type) || PC_EV_IS_NOTIFY_SENT(ev->type) || PC_EV_IS_NET_EVENT(ev->type));

    if (PC_EV_IS_RESP(ev->type)) {
        pc__trans_resp(client, ev->data.req.req_id, ev->data.req.rc, ev->data.req.resp, 0/* not pending */);
        pc_lib_log(PC_LOG_DEBUG, "pc__handle_event - fire pending trans resp, req_id: %u, rc: %s",
                ev->data.req.req_id, pc_client_rc_str(ev->data.req.rc));
        pc_lib_free((char* )ev->data.req.resp);
        ev->data.req.resp = NULL;

    } else if (PC_EV_IS_NOTIFY_SENT(ev->type)) {
        pc__trans_sent(client, ev->data.notify.seq_num, ev->data.notify.rc, 0/* not pending */);
        pc_lib_log(PC_LOG_DEBUG, "pc__handle_event - fire pending trans sent, seq_num: %u, rc: %s",
                ev->data.notify.seq_num, pc_client_rc_str(ev->data.notify.rc));
    } else { 
        pc__trans_fire_event(client, ev->data.ev.ev_type, ev->data.ev.arg1, ev->data.ev.arg2, 0/* not pending */);
        pc_lib_log(PC_LOG_DEBUG, "pc__handle_event - fire pending trans event: %s, arg1: %s",
                pc_client_ev_str(ev->data.ev.ev_type), ev->data.ev.arg1 ? ev->data.ev.arg1 : "");
        pc_lib_free((char* )ev->data.ev.arg1);
        pc_lib_free((char* )ev->data.ev.arg2);

        ev->data.ev.arg1 = NULL;
        ev->data.ev.arg2 = NULL;
    }

    // 能否把这段移动到上面回调的前面?
    QUEUE_REMOVE(&ev->queue);
    QUEUE_INIT(&ev->queue);

    if (PC_IS_DYN_ALLOC(ev->type)) {
        pc_lib_free(ev);
    } else {
        PC_PRE_ALLOC_SET_IDLE(ev->type);
    }
}

Cannot connect to chatofpomelo with libpomelo2

I built libpomelo2 and requested "connector.entryHandler.enter" in order to connect to chatofpomelo game server, but I got this exception below:

[2015-03-30 09:59:11.811] [DEBUG] pomelo - [E:\study\pomelo\chatofpomelo\game-se
rver\node_modules\pomelo\lib\components\connector.js] [gate-server-1] handleMess
age session id: 1, msg: {"id":1,"route":"connector.entryHandler.enter","body":{"
timestamp":1427680751791,"username":"test234","rid":"2"}}

[2015-03-30 09:59:11.811] [ERROR] pomelo - [E:\study\pomelo\chatofpomelo\game-se
rver\node_modules\pomelo\lib\server\server.js] fail to forward message:TypeError
: Cannot call method 'forwardMessage' of undefined
at doForward (E:\study\pomelo\chatofpomelo\game-server\node_modules\pomelo\l
ib\server\server.js:334:50)
at dispatch (E:\study\pomelo\chatofpomelo\game-server\node_modules\pomelo\li
b\server\server.js:103:7)
at next (E:\study\pomelo\chatofpomelo\game-server\node_modules\pomelo\lib\co
mmon\service\filterService.js:50:7)
at Service.beforeFilter (E:\study\pomelo\chatofpomelo\game-server\node_modul
es\pomelo\lib\common\service\filterService.js:65:3)

关于protobuf的一个小问题

由于libpomelo2对于c以外的其它语言采用plugin的形式。
那么当plugin需要使用protobuf来压缩数据时,是不是还要再经过c这层来转换数据?

android libpomelo2

gyp --depth=. -Dtarget_arch=arm -DOS=android -Dpomelo_library=static_library -Dno_tls_support=false -Duse_sys_openssl=false -
Dbuild_jpomelo=true $SSL pomelo.gyp --format=make

or
gyp --depth=. -Dtarget_arch=arm -DOS=android -Dpomelo_library=static_library -Dno_tls_support=true -Duse_sys_openssl=false -
Dbuild_jpomelo=true $SSL pomelo.gyp --format=make

都有这个问题

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "tr_uv_tls_set_ca_file" referenced by "libjpomelo.so"...

pb__get_type & pb__get_constant_type 导致的链接错误

在pb_util.h中声明了以下函数,但在pb_util.c中并没有定义这两个函数。
导致pb_decode.c (在pb_decode_array中调用了函数pb__get_type)链接错误。

/*Helper Function*/
int pb__get_type(const char *type);
int pb__get_constant_type(const char *type);

a bug for libpomelo2

src/pc_trans.c:111: pc__trans_fire_event: assertion "client->state == PC_ST_CONNECTING" failed

When can't connect to server, it will assert failed after call pc_client_disconnect.

I use libpomelo2 in an iOS app. I wan't close connection when app enter background. So I write this code when app enter background.

    for (int i = 0; i < m_count; ++i) {
        if (m_pomelos[i] != nullptr) {
            pc_client_disconnect(m_pomelos[i]);
            pc_client_rm_ev_handler(m_pomelos[i], m_event_handler);
            pc_client_cleanup(m_pomelos[i]);
            free(m_pomelos[i]);
            m_pomelos[i] = nullptr;
        }
    }

Sometime our server is offline for test, so the connection will always timeout.
And it will assert fail in file pc_trans.c.

Maybe there something wrong in my code, so I need some help.

a Compile bug for libpomelo2

ndroid-ndk32-r10-linux-x86.tar.bz2, ubuntu 12.04

root@iZ23p8bfdl5Z:/usr/local/src/libpomelo2-master# make
CC(target) out/Default/obj.target/libuv/deps/uv/src/unix/pthread-fixes.o
deps/uv/src/unix/pthread-fixes.c:39:1: error: unknown type name ‘sigset_t’
deps/uv/src/unix/pthread-fixes.c:39:55: error: unknown type name ‘sigset_t’
make: *** [out/Default/obj.target/libuv/deps/uv/src/unix/pthread-fixes.o] Error 1

iOS使用libpomelo2无法初始化客户端

我在object-c项目中使用libpomelo2,不是pomelo。
http://www.youduoshao.com/2014-11-19/201411192349.html】我根据这篇章编译好了模拟器版和真机版的.a文件并且合并了。将合并好的三个.a添加到项目中,并且添加了pomelo.h文件。但是在项目中无法调用pc_client_t初始化客户端。
1.请问官方有做过相关oc的Demo吗,是否测试在ios oc中可行呢?
2.为什么pomelo.h中的其他方法或者机构体都可以调用,而初始化客户端pc_client_t结构体调用不了?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.