-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetconn.cpp
29 lines (24 loc) · 879 Bytes
/
netconn.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* netconn.cpp
*
* Created on: Apr 24, 2009
* Author: pushkar
*/
#include "netconn.h"
void network_connection_error_cstr(gnet_error err) {
{
switch(err) {
case GNET_OK: fprintf(stderr, "Ok.\n"); break;
case GNET_GETADDR_FAILED: fprintf(stderr, "Get Address Failed.\n"); break;
case GNET_CONNECTION_FAILED: fprintf(stderr, "Get Connection Failed.\n"); break;
case GNET_LISTEN_FAILED: fprintf(stderr, "Listen Failed.\n"); break;
case GNET_SOCKET_FAILED: fprintf(stderr, "Socket Binding Failed.\n"); break;
case GNET_RECV_ERROR: fprintf(stderr, "Failed to receive.\n"); break;
case GNET_SEND_ERROR: fprintf(stderr, "Failed to send.\n"); break;
case GNET_SUBSCRIPTION_ERROR: fprintf(stderr, "Failed to subscribe to data.\n"); break;
case GNET_PUBLISHING_ERROR: fprintf(stderr, "Failed to publish data.\n"); break;
default:
break;
}
}
}