Added NetDescriptor_detach()
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2638 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -138,6 +138,15 @@ NetDescriptor_decRef(NetDescriptor *nd) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The socket will no longer be managed by the NetManager.
|
||||||
|
void
|
||||||
|
NetDescriptor_detach(NetDescriptor *nd) {
|
||||||
|
NetManager_removeDesc(nd);
|
||||||
|
nd->socket = Socket_noSocket;
|
||||||
|
nd->flags.closed = true;
|
||||||
|
NetDescriptor_decRef(nd);
|
||||||
|
}
|
||||||
|
|
||||||
Socket *
|
Socket *
|
||||||
NetDescriptor_getSocket(NetDescriptor *nd) {
|
NetDescriptor_getSocket(NetDescriptor *nd) {
|
||||||
return nd->socket;
|
return nd->socket;
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ NetDescriptor *NetDescriptor_new(Socket *socket, void *extra);
|
|||||||
void NetDescriptor_close(NetDescriptor *nd);
|
void NetDescriptor_close(NetDescriptor *nd);
|
||||||
void NetDescriptor_incRef(NetDescriptor *nd);
|
void NetDescriptor_incRef(NetDescriptor *nd);
|
||||||
bool NetDescriptor_decRef(NetDescriptor *nd);
|
bool NetDescriptor_decRef(NetDescriptor *nd);
|
||||||
|
void NetDescriptor_detach(NetDescriptor *nd);
|
||||||
Socket *NetDescriptor_getSocket(NetDescriptor *nd);
|
Socket *NetDescriptor_getSocket(NetDescriptor *nd);
|
||||||
void NetDescriptor_setExtra(NetDescriptor *nd, void *extra);
|
void NetDescriptor_setExtra(NetDescriptor *nd, void *extra);
|
||||||
void *NetDescriptor_getExtra(const NetDescriptor *nd);
|
void *NetDescriptor_getExtra(const NetDescriptor *nd);
|
||||||
|
|||||||
Reference in New Issue
Block a user