Vault  4.1
vlistenersocket.h
Go to the documentation of this file.
00001 /*
00002 Copyright c1997-2014 Trygve Isaacson. All rights reserved.
00003 This file is part of the Code Vault version 4.1
00004 http://www.bombaydigital.com/
00005 License: MIT. See LICENSE.md in the Vault top level directory.
00006 */
00007 
00008 #ifndef vlistenersocket_h
00009 #define vlistenersocket_h
00010 
00013 #include "vsocket.h"
00014 
00015 class VSocketFactory;
00016 
00037 class VListenerSocket : public VSocket {
00038     public:
00039 
00052         VListenerSocket(int portNumber, const VString& bindAddress, VSocketFactory* factory, int backlog = 50);
00056         virtual ~VListenerSocket();
00057 
00069         VSocket* accept();
00070 
00076         void listen();
00077 
00078     private:
00079 
00080         // Prevent copy construction and assignment since there is no provision for sharing pointer data,
00081         // and it is probably an error anyway to try to create multiple listeners on the same port.
00082         VListenerSocket(const VListenerSocket& other);
00083         VListenerSocket& operator=(const VListenerSocket& other);
00084 
00085         VString         mBindAddress;   
00086         int             mBacklog;       
00087         VSocketFactory* mFactory;       
00088 
00089 };
00090 
00091 #endif /* vlistenersocket_h */

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.