neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize > Class Template Reference

#include <packet_connection.hpp>

Inheritance diagram for neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >:
neolib::lifetime< Base > neolib::i_lifetime

Classes

struct  already_open
 
struct  no_socket
 

Public Types

typedef Protocol protocol_type
 
- Public Types inherited from neolib::lifetime< Base >
typedef neolib::destroyed_flag destroyed_flag
 

Public Member Functions

 basic_packet_connection (i_async_task &aIoTask, owner_type &aOwner, bool aSecure=false, protocol_family aProtocolFamily=IPv4)
 
 basic_packet_connection (i_async_task &aIoTask, owner_type &aOwner, const std::string &aRemoteHostName, unsigned short aRemotePort, bool aSecure=false, protocol_family aProtocolFamily=IPv4)
 
 ~basic_packet_connection ()
 
bool open (const std::string &aRemoteHostName, unsigned short aRemotePort, bool aSecure=false, protocol_family aProtocolFamily=IPv4)
 
bool open (bool aAcceptingSocket=false)
 
void close ()
 
void send_packet (const packet_type &aPacket, bool aHighPriority=false)
 
bool opened () const
 
bool closed () const
 
bool connected () const
 
unsigned short local_port () const
 
unsigned short remote_port () const
 
bool secure () const
 
bool has_error () const
 
const boost::system::error_code & error () const
 
const endpoint_type & local_end_point () const
 
const endpoint_type & remote_end_point () const
 
const socket_type & socket () const
 
socket_type & socket ()
 
const secure_stream_type & secure_stream () const
 
secure_stream_type & secure_stream ()
 
void server_accept ()
 
- Public Member Functions inherited from neolib::lifetime< Base >
 lifetime (lifetime_state aState=lifetime_state::Alive)
 
virtual ~lifetime ()
 
lifetime_state object_state () const final
 
std::shared_ptr< std::atomic< lifetime_state > > object_state_ptr () const final
 
bool is_creating () const final
 
bool is_alive () const final
 
bool is_destroying () const final
 
bool is_destroyed () const final
 
void set_alive () override
 
void set_destroying () override
 
void set_destroyed () override
 
- Public Member Functions inherited from neolib::i_lifetime
virtual ~i_lifetime ()=default
 

Friends

template<typename CharType2 , size_t ReceiveBufferSize2>
const basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 >::socket_type & do_socket (const basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 > &)
 
template<typename CharType2 , size_t ReceiveBufferSize2>
basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 >::socket_type & do_socket (basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 > &)
 

Detailed Description

template<typename CharType, typename Protocol, size_t ReceiveBufferSize = 1024>
class neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >

Definition at line 80 of file packet_connection.hpp.

Member Typedef Documentation

◆ protocol_type

Definition at line 84 of file packet_connection.hpp.

Constructor & Destructor Documentation

◆ basic_packet_connection() [1/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::basic_packet_connection ( i_async_task aIoTask,
owner_type &  aOwner,
bool  aSecure = false,
protocol_family  aProtocolFamily = IPv4 
)
inline

Definition at line 155 of file packet_connection.hpp.

◆ basic_packet_connection() [2/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::basic_packet_connection ( i_async_task aIoTask,
owner_type &  aOwner,
const std::string &  aRemoteHostName,
unsigned short  aRemotePort,
bool  aSecure = false,
protocol_family  aProtocolFamily = IPv4 
)
inline

Definition at line 177 of file packet_connection.hpp.

◆ ~basic_packet_connection()

Member Function Documentation

◆ close()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
void neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::close ( )
inline

Definition at line 248 of file packet_connection.hpp.

◆ closed()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::closed ( ) const
inline

Definition at line 277 of file packet_connection.hpp.

◆ connected()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::connected ( ) const
inline

Definition at line 281 of file packet_connection.hpp.

◆ error()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
const boost::system::error_code & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::error ( ) const
inline

Definition at line 301 of file packet_connection.hpp.

◆ has_error()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::has_error ( ) const
inline

Definition at line 297 of file packet_connection.hpp.

◆ local_end_point()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
const endpoint_type & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::local_end_point ( ) const
inline

Definition at line 305 of file packet_connection.hpp.

◆ local_port()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
unsigned short neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::local_port ( ) const
inline

Definition at line 285 of file packet_connection.hpp.

◆ open() [1/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::open ( bool  aAcceptingSocket = false)
inline

Definition at line 223 of file packet_connection.hpp.

◆ open() [2/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::open ( const std::string &  aRemoteHostName,
unsigned short  aRemotePort,
bool  aSecure = false,
protocol_family  aProtocolFamily = IPv4 
)
inline

Definition at line 210 of file packet_connection.hpp.

◆ opened()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::opened ( ) const
inline

Definition at line 266 of file packet_connection.hpp.

◆ remote_end_point()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
const endpoint_type & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::remote_end_point ( ) const
inline

Definition at line 309 of file packet_connection.hpp.

◆ remote_port()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
unsigned short neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::remote_port ( ) const
inline

Definition at line 289 of file packet_connection.hpp.

◆ secure()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
bool neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::secure ( ) const
inline

Definition at line 293 of file packet_connection.hpp.

◆ secure_stream() [1/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
secure_stream_type & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::secure_stream ( )
inline

Definition at line 331 of file packet_connection.hpp.

◆ secure_stream() [2/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
const secure_stream_type & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::secure_stream ( ) const
inline

Definition at line 325 of file packet_connection.hpp.

◆ send_packet()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
void neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::send_packet ( const packet_type &  aPacket,
bool  aHighPriority = false 
)
inline

Definition at line 261 of file packet_connection.hpp.

◆ server_accept()

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
void neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::server_accept ( )
inline

Definition at line 337 of file packet_connection.hpp.

◆ socket() [1/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
socket_type & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::socket ( )
inline

Definition at line 321 of file packet_connection.hpp.

◆ socket() [2/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
const socket_type & neolib::basic_packet_connection< CharType, Protocol, ReceiveBufferSize >::socket ( ) const
inline

Definition at line 315 of file packet_connection.hpp.

Friends And Related Symbol Documentation

◆ do_socket [1/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
template<typename CharType2 , size_t ReceiveBufferSize2>
basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 >::socket_type & do_socket ( basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 > &  )
friend

◆ do_socket [2/2]

template<typename CharType , typename Protocol , size_t ReceiveBufferSize = 1024>
template<typename CharType2 , size_t ReceiveBufferSize2>
const basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 >::socket_type & do_socket ( const basic_packet_connection< CharType2, Protocol, ReceiveBufferSize2 > &  )
friend

The documentation for this class was generated from the following file: