TCP/IP Lean: Web Servers for Embedded Systems, Second Edition

TCP Implementation

TCP States

Each TCP state is defined as an enumeration and as a string for diagnostic printouts.

<span style="background-color:d9d9d9">/* TCP states */</span><span style="background-color:d9d9d9">#define TSTATE_STRINGS \</span>    <span style="background-color:d9d9d9">"closed",       "SYN rcvd",     "established", \</span>    <span style="background-color:d9d9d9">"close wait",   "last ACK",     "reset rcvd",   \</span>    <span style="background-color:d9d9d9">"active open",  "ARP sent",     "ARP rcvd",     "SYN sent", \</span>    <span style="background-color:d9d9d9">"active close", "FIN wait 1",   "FIN wait 2",   "closing",\</span>    <span style="background-color:d9d9d9">"timed wait"</span><span style="background-color:d9d9d9">typedef enum {</span>    <span style="background-color:d9d9d9">/* Passive open <span class="unicode">&</span> close */</span>    <span style="background-color:d9d9d9">TCP_CLOSED,              /* Closed */</span>    <span style="background-color:d9d9d9">TCP_SYNR,                /* SYN recvd: send SYN ACK */</span>    <span style="background-color:d9d9d9">TCP_EST,                 /* Established: connection OK */</span>    <span style="background-color:d9d9d9">TCP_CLWAIT,              /* Close wait: FIN recvd, send data then FIN ACK */</span>    <span style="background-color:d9d9d9">TCP_LASTACK,             /* Last ACK: waiting for ACK...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Vacuum Pumps and Vacuum Generators
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.