Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教,使用libpomelo连接chatofpomelo的gameserver为什么会失败。。 #7

Open
jncpp opened this issue Nov 1, 2013 · 2 comments

Comments

@jncpp
Copy link

jncpp commented Nov 1, 2013

const char *ip = "127.0.0.1";
int port = 3014;
int main() {
// create a client instance.
pc_client_t *client = pc_client_new();

struct sockaddr_in address;

memset(&address, 0, sizeof(struct sockaddr_in));
address.sin_family = AF_INET;
address.sin_port = htons(port);
address.sin_addr.s_addr = inet_addr(ip);

// add some event callback.
pc_add_listener(client, PC_EVENT_DISCONNECT, on_close);

// try to connect to server.
if(pc_client_connect(client, &address)) {
printf("fail to connect server.\n");
pc_client_destroy(client);
return 1;
}else{
printf("connect success!");
}
}

输出结果:fail to connect server.

@bonly
Copy link

bonly commented Nov 15, 2013

好像是协议问题,把pomelo.connectors.hybridconnector去掉试试!

@LowLowCoder-Mel
Copy link

请教 现在安卓的还能连接基于socketio的服务端么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants