WvStreams
include/wvunixlistener.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 */
6#ifndef __WVUNIXLISTENER_H
7#define __WVUNIXLISTENER_H
8
9#include "wvlistener.h"
10#include "wvaddr.h"
11
12#ifndef _WIN32
13
15class WvUnixListener : public WvListener
16{
17public:
18 WvUnixListener(const WvUnixAddr &_addr, int create_mode);
19 virtual ~WvUnixListener();
20 virtual void close();
21
29
31 virtual const WvUnixAddr *src() const;
32
33protected:
34 WvUnixAddr addr;
35 bool bound_okay;
36
37 void accept_callback(WvIStreamList *list,
38 wv::function<void(IWvStream*)> cb,
39 IWvStream *_connection);
40
41public:
42 const char *wstype() const { return "WvUnixListener"; }
43};
44
45#endif // _WIN32
46
47#endif // __WVUNIXLISTENER_H
WvStreamList holds a list of WvStream objects – and its select() and callback() functions know how to...
A Unix domain socket address is really just a filename.
virtual const WvUnixAddr * src() const
src() is a bit of a misnomer, but it returns the socket address.
IWvStream * accept()
return a new WvUnixConn socket corresponding to a newly-accepted connection.