psocksxx 1.1.1
Loading...
Searching...
No Matches
nsockstream.h
1/*
2* psocksxx - A C++ wrapper for POSIX sockets
3* Copyright (C) 2013 Uditha Atukorala
4*
5* This software library is free software; you can redistribute it and/or modify
6* it under the terms of the GNU Lesser General Public License as published by
7* the Free Software Foundation; either version 3 of the License, or
8* (at your option) any later version.
9*
10* This software library is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU Lesser General Public License for more details.
14*
15* You should have received a copy of the GNU Lesser General Public License
16* along with this software library. If not, see <http://www.gnu.org/licenses/>.
17*
18*/
19
20#ifndef PSOCKSXX_NSOCKSTREAM_H
21#define PSOCKSXX_NSOCKSTREAM_H
22
23#include <psocksxx/iosockstream.h>
24#include <psocksxx/nsockaddr.h>
25
26
27namespace psocksxx {
28
36 class nsockstream : public iosockstream {
37 public:
38
49
61 nsockstream( sockstreambuf * ssb ) throw();
62
66 virtual ~nsockstream() throw();
67
79 void connect( const nsockaddr * saddr ) throw( sockexception, socktimeoutexception );
80
93 void connect( const char * node, unsigned int port ) throw( sockexception, socktimeoutexception );
94
107 void bind( const nsockaddr * saddr, bool reuse_addr = false ) throw( sockexception );
108
122 void listen( int backlog = 0 ) throw( sockexception );
123
136 nsockstream * accept() throw( sockexception );
137
138 };
139
140} /* end of namespace psocksxx */
141
142#endif /* !PSOCKSXX_NSOCKSTEAM_H */
143
Input and Output controller class for socket streams.
Definition iosockstream.h:39
Socket address class for IPv4 addresses.
Definition nsockaddr.h:37
Network (IPv4) controller class.
Definition nsockstream.h:36
virtual ~nsockstream()
destructor
Definition nsockstream.cpp:45
void listen(int backlog=0)
make this stream passive and ready to accept connections
Definition nsockstream.cpp:86
void bind(const nsockaddr *saddr, bool reuse_addr=false)
bind the stream to a network address
Definition nsockstream.cpp:75
void connect(const nsockaddr *saddr)
connect to a network address
Definition nsockstream.cpp:53
nsockstream * accept()
accept a connection on a listening (passive) stream
Definition nsockstream.cpp:100
Socket exception.
Definition sockexception.h:35
Socket stream buffer class.
Definition sockstreambuf.h:53
socket_protocol_t
Definition sockstreambuf.h:83
socket_type_t
Definition sockstreambuf.h:74
Socket timeout exception.
Definition socktimeoutexception.h:36