[][src]Struct grin_p2p::Server

pub struct Server {
    pub config: P2PConfig,
    pub peers: Arc<Peers>,
    // some fields omitted
}

P2P server implementation, handling bootstrapping to find and connect to peers, receiving connections from other peers and keep track of all of them.

Fields

Methods

impl Server
[src]

Creates a new idle p2p server with no peers

Starts a new TCP server and listen to incoming connections. This is a blocking call until the TCP server stops.

Asks the server to connect to a new peer. Directly returns the peer if we're already connected to the provided address.

Pause means: stop all the current peers connection, only for tests. Note:

  1. must pause the 'seed' thread also, to avoid the new egress peer connection
  2. must pause the 'p2p-server' thread also, to avoid the new ingress peer connection.

Auto Trait Implementations

impl Send for Server

impl Sync for Server

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same for T

Should always be Self

impl<T> SafeBorrow for T where
    T: ?Sized