Struct ckb_network::ServiceBuilder
source · [−]pub struct ServiceBuilder { /* private fields */ }Expand description
Builder for Service
Implementations
New a default empty builder
Combine the configuration of this builder with service handle to create a Service.
Insert a custom protocol
Enable encrypted communication mode.
If you do not need encrypted communication, you do not need to call this method
When the service has no tasks, it will be turned off by default. If you do not want to close service, set it to true.
Timeout for handshake and connect
Default 10 second
Yamux config for service
Panic when max_frame_length < yamux_max_window_size
Secio max frame length
Panic when max_frame_length < yamux_max_window_size
Set send buffer size, default is 24Mb
Set receive buffer size, default is 24Mb
If session is close by remote, did you want to keep unreceived message as more as possible default is false
Whether to allow tentative registration upnp, default is disable(false)
upnp: https://en.wikipedia.org/wiki/Universal_Plug_and_Play
Upnp is a simple solution to nat penetration, which requires routing support for registration mapping.
The function provided here is that if the external ip of the query route is a public network, then an attempt is made to register the local listener port into the mapping so that it can receive the access request of the external network, and if the external ip of the route is not the public network, Then do nothing
The limit of max open connection(file descriptors) If not limited, service will try to serve as many connections as possible until it exhausts system resources(os error), and then close the listener, no longer accepting new connection requests, and the established connections remain working
Default is 65535
Bind all the outbound connections to the local listening address.
In this way, any actively connected outbound connection is potentially connectable. Through this setting, the device after NAT can have the opportunity to be connected to the public network.
TCP Hole Punching: http://bford.info/pub/net/p2pnat/ STUN: https://tools.ietf.org/html/rfc5389
Trait Implementations
Returns the “default value” for a type. Read more