Loading...
Searching...
No Matches
nsockstream.h
/*
* psocksxx - A C++ wrapper for POSIX sockets
* Copyright (C) 2013 Uditha Atukorala
*
* This software library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This software library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef PSOCKSXX_NSOCKSTREAM_H
#define PSOCKSXX_NSOCKSTREAM_H
#include <psocksxx/iosockstream.h>
#include <psocksxx/nsockaddr.h>
namespace psocksxx {
class nsockstream : public iosockstream {
public:
nsockstream( sockstreambuf::socket_type_t type, sockstreambuf::socket_protocol_t proto ) throw( sockexception );
nsockstream( sockstreambuf * ssb ) throw();
virtual ~nsockstream() throw();
void connect( const nsockaddr * saddr ) throw( sockexception, socktimeoutexception );
void connect( const char * node, unsigned int port ) throw( sockexception, socktimeoutexception );
void bind( const nsockaddr * saddr, bool reuse_addr = false ) throw( sockexception );
void listen( int backlog = 0 ) throw( sockexception );
nsockstream * accept() throw( sockexception );
};
} /* end of namespace psocksxx */
#endif /* !PSOCKSXX_NSOCKSTEAM_H */
psocksxx::iosockstream
Input and Output controller class for socket streams.
Definition iosockstream.h:39
psocksxx::nsockaddr
Socket address class for IPv4 addresses.
Definition nsockaddr.h:37
psocksxx::nsockstream
Network (IPv4) controller class.
Definition nsockstream.h:36
psocksxx::nsockstream::~nsockstream
virtual ~nsockstream()
destructor
Definition nsockstream.cpp:45
psocksxx::nsockstream::listen
void listen(int backlog=0)
make this stream passive and ready to accept connections
Definition nsockstream.cpp:86
psocksxx::nsockstream::bind
void bind(const nsockaddr *saddr, bool reuse_addr=false)
bind the stream to a network address
Definition nsockstream.cpp:75
psocksxx::nsockstream::connect
void connect(const nsockaddr *saddr)
connect to a network address
Definition nsockstream.cpp:53
psocksxx::nsockstream::accept
nsockstream * accept()
accept a connection on a listening (passive) stream
Definition nsockstream.cpp:100
psocksxx::sockexception
Socket exception.
Definition sockexception.h:35
psocksxx::sockstreambuf
Socket stream buffer class.
Definition sockstreambuf.h:53
psocksxx::sockstreambuf::socket_protocol_t
socket_protocol_t
Definition sockstreambuf.h:83
psocksxx::sockstreambuf::socket_type_t
socket_type_t
Definition sockstreambuf.h:74
psocksxx::socktimeoutexception
Socket timeout exception.
Definition socktimeoutexception.h:36