Changeset 2576 for trunk/libtransmission/net.h
- Timestamp:
- Jul 31, 2007, 4:55:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/net.h
r2573 r2576 26 26 #define _TR_NET_H_ 27 27 28 #if defined(BEOS_NETSERVER) || defined(__MINGW__) 29 #include <stdint.h> 30 typedef uint16_t tr_port_t; 28 #ifdef WIN32 29 #include <stdint.h> 30 #include <winsock2.h> 31 typedef uint16_t tr_port_t; 31 32 #else 32 #include <arpa/inet.h> 33 typedef in_port_t tr_port_t; 33 #include <sys/socket.h> 34 #include <netinet/in.h> 35 #include <arpa/inet.h> 36 typedef in_port_t tr_port_t; 37 #endif 38 39 #ifdef SYS_BEOS 40 #include <stdint.h> 41 typedef uint32_t socklen_t; 42 #endif 43 44 #ifdef WIN32 45 #define EAGAIN WSAEAGAIN 46 #define ECONNREFUSED WSAECONNREFUSED 47 #define ECONNRESET WSAECONNRESET 48 #define EHOSTUNREACH WSAEHOSTUNREACH 49 #define EINPROGRESS WSAEINPROGRESS 50 #define ENOTCONN WSAENOTCONN 51 #define EWOULDBLOCK WSAEWOULDBLOCK 52 #define sockerrno WSAGetLastError( ) 53 #else 54 #include <errno.h> 55 #define sockerrno errno 56 #endif 57 58 #ifndef INADDR_NONE 59 #define INADDR_NONE 0xffffffff 34 60 #endif 35 61 … … 43 69 44 70 typedef struct tr_resolve_s tr_resolve_t; 45 void tr_netResolveThreadInit( );46 void tr_netResolveThreadClose( );71 void tr_netResolveThreadInit( void ); 72 void tr_netResolveThreadClose( void ); 47 73 tr_resolve_t * tr_netResolveInit( const char * address ); 48 74 tr_tristate_t tr_netResolvePulse( tr_resolve_t *, struct in_addr * ); … … 53 79 * TCP and UDP sockets 54 80 **********************************************************************/ 55 int tr_netOpenTCP ( const struct in_addr * addr, tr_port_t port, int priority );56 int tr_netOpenUDP ( const struct in_addr * addr, tr_port_t port, int priority );81 int tr_netOpenTCP ( const struct in_addr * addr, tr_port_t port, int priority ); 82 int tr_netOpenUDP ( const struct in_addr * addr, tr_port_t port, int priority ); 57 83 int tr_netMcastOpen( int port, const struct in_addr * addr ); 58 int tr_netBindTCP ( int port );59 int tr_netBindUDP ( int port );60 int tr_netAccept ( int s, struct in_addr *, tr_port_t * );61 void tr_netClose ( int s );84 int tr_netBindTCP ( int port ); 85 int tr_netBindUDP ( int port ); 86 int tr_netAccept ( int s, struct in_addr *, tr_port_t * ); 87 void tr_netClose ( int s ); 62 88 63 89 #define TR_NET_BLOCK 0x80000000
Note: See TracChangeset
for help on using the changeset viewer.