WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
nt::NetworkConnection Class Reference

Public Types

enum  State {
  kCreated, kInit, kHandshake, kSynchronized,
  kActive, kDead
}
 
typedef std::function< bool(NetworkConnection
&conn, std::function
< std::shared_ptr< Message >)> 
get_msg
 
typedef std::function< bool(NetworkConnection
&conn, std::function
< std::shared_ptr< Message >
)> std::function< void(llvm::ArrayRef
< std::shared_ptr< Message >
>)> send_msgs 
HandshakeFunc
 
typedef std::function< void(std::shared_ptr
< Message > msg,
NetworkConnection *conn)> 
ProcessIncomingFunc
 
typedef std::vector
< std::shared_ptr< Message > > 
Outgoing
 
typedef wpi::ConcurrentQueue
< Outgoing > 
OutgoingQueue
 

Public Member Functions

 NetworkConnection (std::unique_ptr< wpi::NetworkStream > stream, Notifier &notifier, HandshakeFunc handshake, Message::GetEntryTypeFunc get_entry_type)
 
void set_process_incoming (ProcessIncomingFunc func)
 
void Start ()
 
void Stop ()
 
ConnectionInfo info () const
 
bool active () const
 
wpi::NetworkStream & stream ()
 
void QueueOutgoing (std::shared_ptr< Message > msg)
 
void PostOutgoing (bool keep_alive)
 
void NotifyIfActive (ConnectionListenerCallback callback) const
 
unsigned int uid () const
 
unsigned int proto_rev () const
 
void set_proto_rev (unsigned int proto_rev)
 
State state () const
 
void set_state (State state)
 
std::string remote_id () const
 
void set_remote_id (StringRef remote_id)
 
unsigned long long last_update () const
 
 NetworkConnection (const NetworkConnection &)=delete
 
NetworkConnectionoperator= (const NetworkConnection &)=delete
 

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