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
13class WvIStreamList;
14
17{
18public:
23 WvTCPListener(const WvIPPortAddr &_listenport);
24
25 virtual ~WvTCPListener();
26
33 virtual IWvStream *accept();
34
36 virtual const WvIPPortAddr *src() const;
37
38protected:
39 WvIPPortAddr listenport;
40 void accept_callback(WvIStreamList *list,
41 wv::function<void(IWvStream*)> cb,
42 IWvStream *_connection);
43
44public:
45 const char *wstype() const { return "WvTCPListener"; }
46};
47
48
49#endif // __WVTCP_H
An IP+Port address also includes a port number, with the resulting form www.xxx.yyy....
Definition wvaddr.h:394
WvStreamList holds a list of WvStream objects – and its select() and callback() functions know how to...
Class to easily create the Server side of a WvTCPConn.
virtual IWvStream * accept()
return a new WvTCPConn socket corresponding to a newly-accepted connection.
Definition wvtcp.cc:432
virtual const WvIPPortAddr * src() const
src() is a bit of a misnomer, but it returns the listener port.
Definition wvtcp.cc:462