pub struct RemoteUdpSocket { /* private fields */ }Expand description
UDP socket transported through standard or extended LazyCat RemoteSocks.
Implementations§
Source§impl RemoteUdpSocket
impl RemoteUdpSocket
Sourcepub const fn local_addr(&self) -> &SocksAddress
pub const fn local_addr(&self) -> &SocksAddress
Local UDP address used by this transport.
Sourcepub const fn peer_addr(&self) -> Option<&SocksAddress>
pub const fn peer_addr(&self) -> Option<&SocksAddress>
Fixed remote peer for associated or connected sockets.
Sourcepub async fn send(&self, payload: &[u8]) -> Result<usize, Error>
pub async fn send(&self, payload: &[u8]) -> Result<usize, Error>
Send one datagram to the fixed peer.
§Errors
Returns an error when this is a bound socket without a fixed peer, the control stream is closed, or the datagram cannot be sent.
Sourcepub async fn recv(&self, payload: &mut [u8]) -> Result<usize, Error>
pub async fn recv(&self, payload: &mut [u8]) -> Result<usize, Error>
Receive one datagram from the fixed peer, filtering other sources.
§Errors
Returns an error when this is a bound socket without a fixed peer, the control stream closes, or a proxy datagram is malformed.
Sourcepub async fn send_to(
&self,
payload: &[u8],
target: &SocksAddress,
) -> Result<usize, Error>
pub async fn send_to( &self, payload: &[u8], target: &SocksAddress, ) -> Result<usize, Error>
Send one datagram to an explicit target.
Standard associations use RFC 1928 UDP headers. LazyCat 0xe2 and
0xe3 transports use the SDK’s length/IP/port stream framing.
§Errors
Returns an error for oversized frames, unsupported target address forms, closed control streams, or transport write failures.
Sourcepub async fn recv_from(
&self,
payload: &mut [u8],
) -> Result<(usize, SocksAddress), Error>
pub async fn recv_from( &self, payload: &mut [u8], ) -> Result<(usize, SocksAddress), Error>
Receive one datagram and its encoded source address.
Standard-association packets not sent by the negotiated relay are ignored.
§Errors
Returns an error when a control stream closes or a datagram has invalid framing or address fields.
Trait Implementations§
Source§impl Debug for RemoteUdpSocket
impl Debug for RemoteUdpSocket
Source§impl Drop for RemoteUdpSocket
impl Drop for RemoteUdpSocket
Auto Trait Implementations§
impl !Freeze for RemoteUdpSocket
impl !RefUnwindSafe for RemoteUdpSocket
impl Send for RemoteUdpSocket
impl Sync for RemoteUdpSocket
impl Unpin for RemoteUdpSocket
impl UnsafeUnpin for RemoteUdpSocket
impl UnwindSafe for RemoteUdpSocket
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request