Wizard
Software Engineering Project - Wizard
Loading...
Searching...
No Matches
unix_acceptor.h
Go to the documentation of this file.
1
10
11// --------------------------------------------------------------------------
12// This file is part of the "sockpp" C++ socket library.
13//
14// Copyright (c) 2014-2017 Frank Pagliughi
15// All rights reserved.
16//
17// Redistribution and use in source and binary forms, with or without
18// modification, are permitted provided that the following conditions are
19// met:
20//
21// 1. Redistributions of source code must retain the above copyright notice,
22// this list of conditions and the following disclaimer.
23//
24// 2. Redistributions in binary form must reproduce the above copyright
25// notice, this list of conditions and the following disclaimer in the
26// documentation and/or other materials provided with the distribution.
27//
28// 3. Neither the name of the copyright holder nor the names of its
29// contributors may be used to endorse or promote products derived from this
30// software without specific prior written permission.
31//
32// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
33// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
34// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
35// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
36// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
37// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
38// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
39// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43// --------------------------------------------------------------------------
44
45#ifndef __sockpp_unix_acceptor_h
46#define __sockpp_unix_acceptor_h
47
48#include "sockpp/acceptor.h"
50
51namespace sockpp {
52
54
61
62class unix_acceptor : public acceptor
63{
65 using base = acceptor;
66
67 // Non-copyable
68 unix_acceptor(const unix_acceptor&) =delete;
69 unix_acceptor& operator=(const unix_acceptor&) =delete;
70
71public:
81 unix_acceptor(const unix_address& addr, int queSize=DFLT_QUE_SIZE) {
82 open(addr, queSize);
83 }
92 using base::open;
99 bool open(const unix_address& addr, int queSize=DFLT_QUE_SIZE) {
100 return base::open(addr, queSize);
101 }
108};
109
111// end namespace sockpp
112};
113
114#endif // __sockpp_unix_acceptor_h
115
Definition acceptor.h:64
stream_socket accept(sock_address *clientAddr=nullptr)
Definition acceptor.cpp:98
bool open(const sock_address &addr, int queSize=DFLT_QUE_SIZE, bool reuseSock=true)
Definition acceptor.cpp:62
acceptor()
Definition acceptor.h:92
static const int DFLT_QUE_SIZE
Definition acceptor.h:74
sock_address_any address() const
Definition socket.cpp:195
Definition stream_socket.h:246
Definition unix_acceptor.h:63
unix_socket accept()
Definition unix_acceptor.h:107
unix_acceptor()
Definition unix_acceptor.h:75
unix_address address() const
Definition unix_acceptor.h:88
bool open(const unix_address &addr, int queSize=DFLT_QUE_SIZE)
Definition unix_acceptor.h:99
unix_acceptor(const unix_address &addr, int queSize=DFLT_QUE_SIZE)
Definition unix_acceptor.h:81
Definition unix_address.h:66