Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::tcp_socket::impl Class Reference
Inheritance diagram for fc::tcp_socket::impl:
Collaboration diagram for fc::tcp_socket::impl:

Public Member Functions

 impl ()
 
 ~impl ()
 
virtual size_t readsome (boost::asio::ip::tcp::socket &socket, char *buffer, size_t length) override
 
virtual size_t readsome (boost::asio::ip::tcp::socket &socket, const std::shared_ptr< char > &buffer, size_t length, size_t offset) override
 
virtual size_t writesome (boost::asio::ip::tcp::socket &socket, const char *buffer, size_t length) override
 
virtual size_t writesome (boost::asio::ip::tcp::socket &socket, const std::shared_ptr< const char > &buffer, size_t length, size_t offset) override
 

Public Attributes

future< size_t > _write_in_progress
 
future< size_t > _read_in_progress
 
boost::asio::ip::tcp::socket _sock
 
tcp_socket_io_hooks * _io_hooks
 

Detailed Description

Definition at line 22 of file tcp_socket.cpp.

Constructor & Destructor Documentation

◆ impl()

fc::tcp_socket::impl::impl ( )
inline

Definition at line 24 of file tcp_socket.cpp.

24 :
25 _sock(fc::asio::default_io_service()),
26 _io_hooks(this)
27 {}
boost::asio::ip::tcp::socket _sock
tcp_socket_io_hooks * _io_hooks

◆ ~impl()

fc::tcp_socket::impl::~impl ( )
inline

Definition at line 28 of file tcp_socket.cpp.

29 {
30 if( _sock.is_open() )
31 try
32 {
33 _sock.close();
34 }
35 catch( ... )
36 {}
37 if( _read_in_progress.valid() )
38 try
39 {
41 }
42 catch ( ... )
43 {
44 }
45 if( _write_in_progress.valid() )
46 try
47 {
49 }
50 catch ( ... )
51 {
52 }
53 }
future< size_t > _write_in_progress
future< size_t > _read_in_progress

Member Function Documentation

◆ readsome() [1/2]

size_t fc::tcp_socket::impl::readsome ( boost::asio::ip::tcp::socket & socket,
char * buffer,
size_t length )
overridevirtual

Definition at line 65 of file tcp_socket.cpp.

66 {
67 return (_read_in_progress = fc::asio::read_some(socket, buffer, length)).get();
68 }

◆ readsome() [2/2]

size_t fc::tcp_socket::impl::readsome ( boost::asio::ip::tcp::socket & socket,
const std::shared_ptr< char > & buffer,
size_t length,
size_t offset )
overridevirtual

Definition at line 69 of file tcp_socket.cpp.

70 {
71 return (_read_in_progress = fc::asio::read_some(socket, buffer, length, offset)).get();
72 }

◆ writesome() [1/2]

size_t fc::tcp_socket::impl::writesome ( boost::asio::ip::tcp::socket & socket,
const char * buffer,
size_t length )
overridevirtual

Definition at line 73 of file tcp_socket.cpp.

74 {
75 return (_write_in_progress = fc::asio::write_some(socket, buffer, length)).get();
76 }

◆ writesome() [2/2]

size_t fc::tcp_socket::impl::writesome ( boost::asio::ip::tcp::socket & socket,
const std::shared_ptr< const char > & buffer,
size_t length,
size_t offset )
overridevirtual

Definition at line 77 of file tcp_socket.cpp.

78 {
79 return (_write_in_progress = fc::asio::write_some(socket, buffer, length, offset)).get();
80 }

Member Data Documentation

◆ _io_hooks

tcp_socket_io_hooks* fc::tcp_socket::impl::_io_hooks

Definition at line 62 of file tcp_socket.cpp.

◆ _read_in_progress

future<size_t> fc::tcp_socket::impl::_read_in_progress

Definition at line 60 of file tcp_socket.cpp.

◆ _sock

boost::asio::ip::tcp::socket fc::tcp_socket::impl::_sock

Definition at line 61 of file tcp_socket.cpp.

◆ _write_in_progress

future<size_t> fc::tcp_socket::impl::_write_in_progress

Definition at line 59 of file tcp_socket.cpp.


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