pub struct TcpPlane { /* private fields */ }Expand description
TCP data plane for direct TCP tunnel connections
Implementations§
Source§impl TcpPlane
impl TcpPlane
pub fn new( router: Arc<Router>, port_allocator: Arc<PortAllocator>, tcp_registry: TcpConnectionRegistry, stream_id_gen: Arc<StreamIdGenerator>, ) -> Arc<Self>
Sourcepub async fn allocate_and_listen(
self: Arc<Self>,
subdomain: String,
) -> Result<u16>
pub async fn allocate_and_listen( self: Arc<Self>, subdomain: String, ) -> Result<u16>
Allocate a port and start listening for TCP connections
Sourcepub fn release_port(&self, port: u16)
pub fn release_port(&self, port: u16)
Release a port when tunnel is closed
Sourcepub fn get_writer(&self, stream_id: u64) -> Option<Sender<Vec<u8>>>
pub fn get_writer(&self, stream_id: u64) -> Option<Sender<Vec<u8>>>
Get write channel for a stream
Sourcepub fn close_connection(&self, stream_id: u64)
pub fn close_connection(&self, stream_id: u64)
Close a TCP connection
Auto Trait Implementations§
impl Freeze for TcpPlane
impl !RefUnwindSafe for TcpPlane
impl Send for TcpPlane
impl Sync for TcpPlane
impl Unpin for TcpPlane
impl !UnwindSafe for TcpPlane
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more