(libT) remove dead code

This commit is contained in:
Charles Kerr
2008-05-28 16:52:31 +00:00
parent ae9415ebf8
commit cd6ef35854
2 changed files with 0 additions and 48 deletions

View File

@@ -204,45 +204,6 @@ tr_netAccept( int b, struct in_addr * addr, tr_port_t * port )
return makeSocketNonBlocking( tr_fdSocketAccept( b, addr, port ) );
}
int
tr_netSend( int s, const void * buf, int size )
{
const int ret = send( s, buf, size, 0 );
if( ret >= 0 )
return ret;
if( sockerrno == ENOTCONN || sockerrno == EAGAIN || sockerrno == EWOULDBLOCK )
return TR_NET_BLOCK;
return TR_NET_CLOSE;
}
int tr_netRecvFrom( int s, uint8_t * buf, int size, struct sockaddr_in * addr )
{
socklen_t len;
int ret;
len = ( NULL == addr ? 0 : sizeof( *addr ) );
ret = recvfrom( s, buf, size, 0, ( struct sockaddr * ) addr, &len );
if( ret < 0 )
{
if( sockerrno == EAGAIN || sockerrno == EWOULDBLOCK )
{
ret = TR_NET_BLOCK;
}
else
{
ret = TR_NET_CLOSE;
}
}
if( !ret )
{
ret = TR_NET_CLOSE;
}
return ret;
}
void
tr_netClose( int s )
{

View File

@@ -76,17 +76,8 @@ int tr_netAccept ( int s, struct in_addr *, tr_port_t * );
int tr_netSetTOS ( int s, int tos );
void tr_netClose ( int s );
#define TR_NET_BLOCK 0x80000000
#define TR_NET_CLOSE 0x40000000
int tr_netSend ( int s, const void * buf, int size );
#define tr_netRecv( s, buf, size ) tr_netRecvFrom( (s), (buf), (size), NULL )
int tr_netRecvFrom( int s, uint8_t * buf, int size, struct sockaddr_in * );
void tr_netNtop( const struct in_addr * addr, char * buf, int len );
void tr_netInit ( void );
#define tr_addrcmp( aa, bb ) memcmp( ( void * )(aa), ( void * )(bb), 4)
#endif /* _TR_NET_H_ */