2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
6 #ifndef __WVUNIXLISTENER_H
7 #define __WVUNIXLISTENER_H
9 #include "wvlistener.h"
14 /** Server end of a Unix Sockets stream */
15 class WvUnixListener
: public WvListener
18 WvUnixListener(const WvUnixAddr
&_addr
, int create_mode
);
19 virtual ~WvUnixListener();
23 * return a new WvUnixConn socket corresponding to a newly-accepted
24 * connection. If no connection is ready immediately, we wait for
25 * one indefinitely. You can use select(read=true) to check for a
31 * Tell this listener to automatically accept new
32 * connections, assigning them their own callback function 'cb'
33 * Pass list==NULL or run setcallback() to disable auto-accepting.
35 * Be careful not to accept() connections yourself if you do this,
36 * or we may end up accept()ing twice, causing a hang the second time.
38 void auto_accept(WvIStreamList
*list
, wv::function
<void(IWvStream
*)> cb
);
41 * Like auto_accept() above, but always uses the globallist instead
42 * of a user-defined list.
44 void auto_accept(wv::function
<void(IWvStream
*)> cb
);
46 /** src() is a bit of a misnomer, but it returns the socket address. */
47 virtual const WvUnixAddr
*src() const;
53 void accept_callback(WvIStreamList
*list
,
54 wv::function
<void(IWvStream
*)> cb
,
55 IWvStream
*_connection
);
58 const char *wstype() const { return "WvUnixListener"; }
63 #endif // __WVUNIXLISTENER_H