diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-11 17:47:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-11 17:47:47 +0000 |
commit | ba1d557ee3e1380f5b94f3d6c2aea0984d823213 (patch) | |
tree | 1f397ce02dfed39dcc3d0ca0e845123e340ba984 /src/socketengine.cpp | |
parent | 381412179424cac7961c31421f2768ef971783db (diff) |
Added method to check if an fd is in the socketengine or not
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3667 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r-- | src/socketengine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 3df9c2135..bcc8e23af 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -112,6 +112,13 @@ bool SocketEngine::AddFd(int fd, bool readable, char type) return true; } +bool SocketEngine::HasFd(int fd) +{ + if ((fd < 0) || (fd > MAX_DESCRIPTORS)) + return false; + return (ref[fd] != 0); +} + bool SocketEngine::DelFd(int fd) { log(DEBUG,"SocketEngine::DelFd(%d)",fd); |