BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | List of all members
graphene::net::stcp_socket Class Reference

#include <stcp_socket.hpp>

Inheritance diagram for graphene::net::stcp_socket:
fc::iostream fc::ostream fc::istream

Public Member Functions

 stcp_socket ()
 
 ~stcp_socket ()
 
fc::tcp_socketget_socket ()
 
void accept ()
 
void connect_to (const fc::ip::endpoint &remote_endpoint)
 
void bind (const fc::ip::endpoint &local_endpoint)
 
virtual size_t readsome (char *buffer, size_t max)
 
virtual size_t readsome (const std::shared_ptr< char > &buf, size_t len, size_t offset)
 
virtual bool eof () const
 
virtual size_t writesome (const char *buffer, size_t len)
 
virtual size_t writesome (const std::shared_ptr< const char > &buf, size_t len, size_t offset)
 
virtual void flush ()
 
virtual void close ()
 
void get (char &c)
 
fc::sha512 get_shared_secret () const
 
- Public Member Functions inherited from fc::ostream
virtual ~ostream ()
 
void put (char c)
 
ostreamwrite (const char *buf, size_t len)
 
ostreamwrite (const std::shared_ptr< const char > &buf, size_t len, size_t offset=0)
 
- Public Member Functions inherited from fc::istream
virtual ~istream ()
 
istreamread (char *buf, size_t len)
 
istreamread (const std::shared_ptr< char > &buf, size_t len, size_t offset=0)
 
virtual char get ()
 
void get (char &c)
 

Detailed Description

Uses ECDH to negotiate a aes key for communicating with other nodes on the network.

Definition at line 35 of file stcp_socket.hpp.

Constructor & Destructor Documentation

◆ stcp_socket()

graphene::net::stcp_socket::stcp_socket ( )

Definition at line 39 of file stcp_socket.cpp.

◆ ~stcp_socket()

graphene::net::stcp_socket::~stcp_socket ( )

Definition at line 47 of file stcp_socket.cpp.

Member Function Documentation

◆ accept()

void graphene::net::stcp_socket::accept ( )

Definition at line 180 of file stcp_socket.cpp.

◆ bind()

void graphene::net::stcp_socket::bind ( const fc::ip::endpoint local_endpoint)

Definition at line 78 of file stcp_socket.cpp.

◆ close()

void graphene::net::stcp_socket::close ( )
virtual

Implements fc::ostream.

Definition at line 172 of file stcp_socket.cpp.

◆ connect_to()

void graphene::net::stcp_socket::connect_to ( const fc::ip::endpoint remote_endpoint)

Definition at line 72 of file stcp_socket.cpp.

◆ eof()

bool graphene::net::stcp_socket::eof ( ) const
virtual

Definition at line 124 of file stcp_socket.cpp.

◆ flush()

void graphene::net::stcp_socket::flush ( )
virtual

Implements fc::ostream.

Definition at line 166 of file stcp_socket.cpp.

◆ get()

void graphene::net::stcp_socket::get ( char &  c)
inline

Definition at line 57 of file stcp_socket.hpp.

◆ get_shared_secret()

fc::sha512 graphene::net::stcp_socket::get_shared_secret ( ) const
inline

Definition at line 58 of file stcp_socket.hpp.

◆ get_socket()

fc::tcp_socket& graphene::net::stcp_socket::get_socket ( )
inline

Definition at line 40 of file stcp_socket.hpp.

◆ readsome() [1/2]

size_t graphene::net::stcp_socket::readsome ( char *  buffer,
size_t  len 
)
virtual

This method must read at least 16 bytes at a time from the underlying TCP socket so that it can decrypt them. It will buffer any left-over.

Implements fc::istream.

Definition at line 88 of file stcp_socket.cpp.

◆ readsome() [2/2]

size_t graphene::net::stcp_socket::readsome ( const std::shared_ptr< char > &  buf,
size_t  len,
size_t  offset 
)
virtual

Implements fc::istream.

Definition at line 119 of file stcp_socket.cpp.

◆ writesome() [1/2]

size_t graphene::net::stcp_socket::writesome ( const char *  buffer,
size_t  len 
)
virtual

every sizeof(crypt_buf) bytes the aes channel has an error and doesn't decrypt properly... disable for now because we are going to upgrade to something better.

Implements fc::ostream.

Definition at line 129 of file stcp_socket.cpp.

◆ writesome() [2/2]

size_t graphene::net::stcp_socket::writesome ( const std::shared_ptr< const char > &  buf,
size_t  len,
size_t  offset 
)
virtual

Implements fc::ostream.

Definition at line 161 of file stcp_socket.cpp.


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