[][src]Enum w5500_ll::SocketStatus

#[repr(u8)]pub enum SocketStatus {
    Closed,
    Init,
    Listen,
    SynSent,
    SynRecv,
    Established,
    FinWait,
    Closing,
    TimeWait,
    CloseWait,
    LastAck,
    Udp,
    Macraw,
}

Socket status.

This is used with crate::Registers::sn_sr.

Variants

Closed

Socket closed, this is the reset state of all sockets.

This state can be set by a SocketCommand::Disconnect or SocketCommand::Close command.

This state will also be set automatically if a timeout occurs.

Init

The socket is opened in TCP mode.

This state is set when the socket protocol is Protocol::Tcp, and a SocketCommand::Open command is sent.

In this state you can use the SocketCommand::Listen and SocketCommand::Connect commands.

Listen

The socket is listening, operating as a TCP server.

The socket will wait for a connextion-request (SYN packet) from a peer (TCP client).

The state will change to SocketStatus::Established when the connection-request is successfully accepted. Otherwise the state will change to SocketStatus::Closed after the TCP timeout duration set by crate::Registers::rcr and crate::Registers::rtr.

SynSent

Connection request (SYN packet) has been sent to a peer.

This is temporarily displayed between the SocketStatus::Init and SocketStatus::Established states, after a SocketCommand::Connect command has been sent.

If the SYN/ACK is received from the peer the state changes to SocketStatus::Established, otherwise the state changes to SocketStatus::Closed after the TCP timeout duration set by crate::Registers::rcr and crate::Registers::rtr.

SynRecv

Connection request (SYN packet) has been received from a peer.

If the socket sends the response (SYN/ACK packet) to the peer successfully the state changes to SocketStatus::Established, otherwise the state changes to SocketStatus::Closed after the TCP timeout duration set by crate::Registers::rcr and crate::Registers::rtr.

Established

TCP connection is established.

When operating as a TCP client this state is set after the TCP server accepts the SYN packet, which is sent by the client after issuing a SocketCommand::Connect.

When operating as a TCP server this state is set after a client connects when in the SocketStatus::Listen state.

While in this state data can be transfered with the SocketCommand::Send and SocketCommand::Recv commands.

FinWait

Temporary status between status transitions.

This indicates the socket is closing.

Closing

Temporary status between status transitions.

This indicates the socket is closing.

TimeWait

Temporary status between status transitions.

This indicates the socket is closing.

CloseWait

The socket has received the disconnect-request (FIN pakcet) from the connected peer.

This is half-closing status, and data can be transferred.

For full-closing the SocketCommand::Disconnect command is used.

For just-closing the SocketCommand::Close command is used.

LastAck

Temporary status between status transitions.

Udp

Socket is opened in UDP mode.

This state is set when the socket protocol is Protocol::Udp, and a SocketCommand::Open command is sent.

Macraw

Socket is opened in MACRAW mode.

This is valid only for socket 0.

This state is set when the socket protocol is Protocol::Macraw, and a SocketCommand::Open command is sent.

Trait Implementations

impl Clone for SocketStatus[src]

impl Copy for SocketStatus[src]

impl Debug for SocketStatus[src]

impl Default for SocketStatus[src]

impl Eq for SocketStatus[src]

impl Hash for SocketStatus[src]

impl Ord for SocketStatus[src]

impl PartialEq<SocketStatus> for SocketStatus[src]

impl PartialOrd<SocketStatus> for SocketStatus[src]

impl StructuralEq for SocketStatus[src]

impl StructuralPartialEq for SocketStatus[src]

impl TryFrom<u8> for SocketStatus[src]

type Error = u8

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.