Loading...
Searching...
No Matches
nsockaddr.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_NSOCKADDR_H
#define PSOCKSXX_NSOCKADDR_H
#include <psocksxx/sockaddr.h>
#include <psocksxx/sockexception.h>
#include <netinet/in.h>
namespace psocksxx {
class nsockaddr : public sockaddr, public sockaddr_in {
public:
nsockaddr( const char * node, unsigned short port ) throw( sockexception );
nsockaddr( unsigned short port ) throw();
nsockaddr( const char * node, const char * service ) throw( sockexception );
// abstract method implementations
socklen_t size() const throw();
::sockaddr* psockaddr() const throw();
protected:
in_addr_t resolve_node( const char * node ) throw( sockexception );
};
} /* end of namespace psockxx */
#endif /* !PSOCKSXX_NSOCKADDR_H */
psocksxx::nsockaddr::resolve_node
in_addr_t resolve_node(const char *node)
convert a node name to a IPv4 address
Definition nsockaddr.cpp:97
psocksxx::nsockaddr::size
socklen_t size() const
get POSIX socket address size
Definition nsockaddr.cpp:127
psocksxx::nsockaddr::psockaddr
::sockaddr * psockaddr() const
get a POSIX socket address structure
Definition nsockaddr.cpp:132
psocksxx::nsockaddr::nsockaddr
nsockaddr(const char *node, unsigned short port)
constructor
Definition nsockaddr.cpp:29
psocksxx::sockaddr
Socket address base class.
Definition sockaddr.h:35
psocksxx::sockexception
Socket exception.
Definition sockexception.h:35