33
33
# include <WS2tcpip.h>
34
34
# pragma warning(pop)
35
35
36
- typedef SOCKET dx_socket_t ;
36
+ typedef SOCKET dx_socket_t ;
37
37
#else
38
38
# include <unistd.h>
39
39
# include <sys/types.h>
40
40
# include <sys/socket.h>
41
41
# include <netinet/in.h>
42
+ # include <arpa/inet.h>
42
43
# include <netdb.h>
43
44
# include <errno.h>
44
45
45
46
# define INVALID_SOCKET -1
46
- # define SOCKET_ERROR -1
47
+ # define SOCKET_ERROR -1
47
48
48
49
typedef int dx_socket_t ;
49
50
#endif /* _WIN32 */
@@ -58,22 +59,21 @@ typedef int dx_socket_t;
58
59
*/
59
60
/* -------------------------------------------------------------------------- */
60
61
61
- int dx_on_connection_created (void );
62
- int dx_on_connection_destroyed (void );
62
+ int dx_on_connection_created (void );
63
+ int dx_on_connection_destroyed (void );
63
64
64
65
/* -------------------------------------------------------------------------- */
65
66
/*
66
67
* Socket function wrappers
67
68
*/
68
69
/* -------------------------------------------------------------------------- */
69
70
70
- dx_socket_t dx_socket (int family , int type , int protocol );
71
- int dx_connect (dx_socket_t s , const struct sockaddr * addr , socklen_t addrlen );
72
- int dx_send (dx_socket_t s , const void * buffer , int buflen );
73
- int dx_recv (dx_socket_t s , void * buffer , int buflen );
74
- int dx_close (dx_socket_t s );
75
- int dx_getaddrinfo (const char * nodename , const char * servname ,
76
- const struct addrinfo * hints , struct addrinfo * * res );
77
- void dx_freeaddrinfo (struct addrinfo * res );
71
+ dx_socket_t dx_socket (int family , int type , int protocol );
72
+ int dx_connect (dx_socket_t s , const struct sockaddr * addr , socklen_t addrlen );
73
+ int dx_send (dx_socket_t s , const void * buffer , int buflen );
74
+ int dx_recv (dx_socket_t s , void * buffer , int buflen );
75
+ int dx_close (dx_socket_t s );
76
+ int dx_getaddrinfo (const char * nodename , const char * servname , const struct addrinfo * hints , struct addrinfo * * res );
77
+ void dx_freeaddrinfo (struct addrinfo * res );
78
78
79
79
#endif /* DX_SOCKETS_H_INCLUDED */
0 commit comments