WvStreams
wvtcplistener.h
1 /* -*- Mode: C++ -*-
2  * Worldvisions Weaver Software:
3  * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4  *
5  * WvStream-based TCP connection and server classes.
6  */
7 #ifndef __WVTCPLISTENER_H
8 #define __WVTCPLISTENER_H
9 
10 #include "wvlistener.h"
11 #include "wvaddr.h"
12 
13 class WvIStreamList;
14 
16 class WvTCPListener : public WvListener
17 {
18 public:
23  WvTCPListener(const WvIPPortAddr &_listenport);
24 
25  virtual ~WvTCPListener();
26 
33  virtual IWvStream *accept();
34 
36  virtual const WvIPPortAddr *src() const;
37 
38 protected:
39  WvIPPortAddr listenport;
40  void accept_callback(WvIStreamList *list,
41  wv::function<void(IWvStream*)> cb,
42  IWvStream *_connection);
43 
44 public:
45  const char *wstype() const { return "WvTCPListener"; }
46 };
47 
48 
49 #endif // __WVTCP_H
WvListener
Definition: wvlistener.h:15
IWvStream
Definition: iwvstream.h:24
WvTCPListener
Class to easily create the Server side of a WvTCPConn.
Definition: wvtcplistener.h:16
WvTCPListener::accept
virtual IWvStream * accept()
return a new WvTCPConn socket corresponding to a newly-accepted connection.
Definition: wvtcp.cc:432
WvIPPortAddr
An IP+Port address also includes a port number, with the resulting form www.xxx.yyy....
Definition: wvaddr.h:393
WvTCPListener::WvTCPListener
WvTCPListener(const WvIPPortAddr &_listenport)
Create a WvStream that listens on _listenport of the current machine This is how you set up a TCP Ser...
Definition: wvtcp.cc:392
WvIStreamList
WvStreamList holds a list of WvStream objects – and its select() and callback() functions know how to...
Definition: wvistreamlist.h:20
WvTCPListener::src
virtual const WvIPPortAddr * src() const
src() is a bit of a misnomer, but it returns the listener port.
Definition: wvtcp.cc:462