refactor out some dead code in net.c, and probably give jhujhiti fits
This commit is contained in:
parent
0705eaa1c0
commit
5ed97a1c04
|
@ -118,12 +118,12 @@ createSocket( int type, int priority )
|
||||||
return makeSocketNonBlocking( tr_fdSocketCreate( type, priority ) );
|
return makeSocketNonBlocking( tr_fdSocketCreate( type, priority ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
tr_netOpen( const struct in_addr * addr, tr_port_t port,
|
tr_netOpenTCP( const struct in_addr * addr, tr_port_t port, int priority )
|
||||||
int type, int priority )
|
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
struct sockaddr_in sock;
|
struct sockaddr_in sock;
|
||||||
|
const int type = SOCK_STREAM;
|
||||||
|
|
||||||
if( ( s = createSocket( type, priority ) ) < 0 )
|
if( ( s = createSocket( type, priority ) ) < 0 )
|
||||||
{
|
{
|
||||||
|
@ -151,18 +151,13 @@ tr_netOpen( const struct in_addr * addr, tr_port_t port,
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
tr_netOpenTCP( const struct in_addr * addr, tr_port_t port, int priority )
|
|
||||||
{
|
|
||||||
return tr_netOpen( addr, port, SOCK_STREAM, priority );
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
int
|
||||||
tr_netBind( int port, int type )
|
tr_netBindTCP( int port )
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
struct sockaddr_in sock;
|
struct sockaddr_in sock;
|
||||||
|
const int type = SOCK_STREAM;
|
||||||
#if defined( SO_REUSEADDR ) || defined( SO_REUSEPORT )
|
#if defined( SO_REUSEADDR ) || defined( SO_REUSEPORT )
|
||||||
int optval;
|
int optval;
|
||||||
#endif
|
#endif
|
||||||
|
@ -192,12 +187,6 @@ tr_netBind( int port, int type )
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
tr_netBindTCP( int port )
|
|
||||||
{
|
|
||||||
return tr_netBind( port, SOCK_STREAM );
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
tr_netAccept( int b, struct in_addr * addr, tr_port_t * port )
|
tr_netAccept( int b, struct in_addr * addr, tr_port_t * port )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue