Line 3:
Line 3:
== Compile and run simple TCP client and server ==
== Compile and run simple TCP client and server ==
The below program is a simple echo server and a client, that pings server with increasing numbers once a second. In this howto we will dump and restore the client part.
The below program is a simple echo server and a client, that pings server with increasing numbers once a second. In this howto we will dump and restore the client part.
−
{| class="collapsible <includeonly>collapsed</includeonly> collapsed" border="0"
+
{| class="mw-collapsible mw-collapsed wikitable"
+
! <code>tcp-howto.c</code>
|-
|-
−
! tcp-howto.c:
+
| <syntaxhighlight lang="c">
−
|-
−
|
−
<pre>
#include <sys/socket.h>
#include <sys/socket.h>
#include <linux/types.h>
#include <linux/types.h>
Line 165:
Line 163:
return 1;
return 1;
}
}
−
</pre>
+
</syntaxhighlight>
|}
|}