WvStreams
|
00001 /* -*- Mode: C++ -*- 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * WvStream-based TCP connection and server classes. 00006 */ 00007 #ifndef __WVTCPLISTENER_H 00008 #define __WVTCPLISTENER_H 00009 00010 #include "wvlistener.h" 00011 #include "wvaddr.h" 00012 00013 class WvIStreamList; 00014 00016 class WvTCPListener : public WvListener 00017 { 00018 public: 00023 WvTCPListener(const WvIPPortAddr &_listenport); 00024 00025 virtual ~WvTCPListener(); 00026 00033 virtual IWvStream *accept(); 00034 00043 void auto_accept(WvIStreamList *list, wv::function<void(IWvStream*)> cb); 00044 00049 void auto_accept(wv::function<void(IWvStream*)> cb); 00050 00052 virtual const WvIPPortAddr *src() const; 00053 00054 protected: 00055 WvIPPortAddr listenport; 00056 void accept_callback(WvIStreamList *list, 00057 wv::function<void(IWvStream*)> cb, 00058 IWvStream *_connection); 00059 00060 public: 00061 const char *wstype() const { return "WvTCPListener"; } 00062 }; 00063 00064 00065 #endif // __WVTCP_H