We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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.
The text was updated successfully, but these errors were encountered:
好像是协议问题,把pomelo.connectors.hybridconnector去掉试试!
Sorry, something went wrong.
请教 现在安卓的还能连接基于socketio的服务端么?
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: