cwIo.h/cpp : Added socketIsConnected().
This commit is contained in:
parent
4aa8621b70
commit
eb674c8411
10
cwIo.cpp
10
cwIo.cpp
@ -2576,6 +2576,16 @@ cw::rc_t cw::io::socketPeername( handle_t h, unsigned sockIdx, struct sockaddr_i
|
||||
return sock::peername( p->sockH, s->userId, addr );
|
||||
}
|
||||
|
||||
bool cw::io::socketIsConnected( handle_t h, unsigned sockIdx )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
socket_t* s;
|
||||
if((s = _socketIndexToRecd(p,sockIdx)) == nullptr )
|
||||
return sock::isConnected( p->sockH, s->userId );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cw::rc_t cw::io::socketSend( handle_t h, unsigned sockIdx, unsigned connId, const void* data, unsigned dataByteCnt )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
|
2
cwIo.h
2
cwIo.h
@ -251,6 +251,8 @@ namespace cw
|
||||
unsigned socketInetAddress( handle_t h, unsigned sockIdx );
|
||||
sock::portNumber_t socketPort( handle_t h, unsigned sockIdx );
|
||||
rc_t socketPeername( handle_t h, unsigned sockIdx, struct sockaddr_in* addr );
|
||||
|
||||
bool socketIsConnected( handle_t h, unsigned sockIdx );
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user