<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ivinpolosony</id>
	<title>CRIU - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ivinpolosony"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Ivinpolosony"/>
	<updated>2026-05-13T11:25:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=Simple_TCP_pair&amp;diff=4828</id>
		<title>Simple TCP pair</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Simple_TCP_pair&amp;diff=4828"/>
		<updated>2019-02-09T19:48:16Z</updated>

		<summary type="html">&lt;p&gt;Ivinpolosony: /* Then restore the client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes step-by-step how to play with TCP dumping and restoring.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Compile and run simple TCP client and server ==&lt;br /&gt;
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.&lt;br /&gt;
{| class=&amp;quot;mw-collapsible mw-collapsed wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;tcp-howto.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| {{:Simple_TCP_pair/tcp-howto.c}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Compile it and run the server:&lt;br /&gt;
&lt;br /&gt;
 # ./tcp-howto &amp;lt;some-port&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On another terminal (for better output readability) run the client:&lt;br /&gt;
&lt;br /&gt;
 # ./tcp-howto 127.0.0.1 &amp;lt;some-port&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Try to dump the client ==&lt;br /&gt;
Create a directory for images (&amp;lt;code&amp;gt;img-dir/&amp;lt;/code&amp;gt; below) and dump the client&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu dump --tree &amp;lt;tcp-howto-client-pid&amp;gt; --images-dir img-dir/ -v4 -o dump.log --shell-job --tcp-established&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;--tcp-established&amp;lt;/code&amp;gt; option is a must, since client have active TCP connection and we should explicitly inform crtools about it.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;--shell-job&amp;lt;/code&amp;gt; option is also required, as the client was launched from shell and uses shell's session and terminal.&lt;br /&gt;
&lt;br /&gt;
== Then restore the client ==&lt;br /&gt;
It's done like this&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu restore --images-dir img-dir/ -v4 -o rst.log --shell-job --tcp-established&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's it. After this in the terminal you launched criu from you should see the continuing output of the tcp client.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[TCP connection]]&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Sockets]]&lt;/div&gt;</summary>
		<author><name>Ivinpolosony</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Simple_TCP_pair&amp;diff=4827</id>
		<title>Simple TCP pair</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Simple_TCP_pair&amp;diff=4827"/>
		<updated>2019-02-09T19:47:42Z</updated>

		<summary type="html">&lt;p&gt;Ivinpolosony: /* Try to dump the client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes step-by-step how to play with TCP dumping and restoring.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Compile and run simple TCP client and server ==&lt;br /&gt;
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.&lt;br /&gt;
{| class=&amp;quot;mw-collapsible mw-collapsed wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;tcp-howto.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| {{:Simple_TCP_pair/tcp-howto.c}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Compile it and run the server:&lt;br /&gt;
&lt;br /&gt;
 # ./tcp-howto &amp;lt;some-port&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On another terminal (for better output readability) run the client:&lt;br /&gt;
&lt;br /&gt;
 # ./tcp-howto 127.0.0.1 &amp;lt;some-port&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Try to dump the client ==&lt;br /&gt;
Create a directory for images (&amp;lt;code&amp;gt;img-dir/&amp;lt;/code&amp;gt; below) and dump the client&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu dump --tree &amp;lt;tcp-howto-client-pid&amp;gt; --images-dir img-dir/ -v4 -o dump.log --shell-job --tcp-established&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;--tcp-established&amp;lt;/code&amp;gt; option is a must, since client have active TCP connection and we should explicitly inform crtools about it.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;--shell-job&amp;lt;/code&amp;gt; option is also required, as the client was launched from shell and uses shell's session and terminal.&lt;br /&gt;
&lt;br /&gt;
== Then restore the client ==&lt;br /&gt;
It's done like this&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu restore --images-dir img-dir/ -v 4 -o rst.log --shell-job --tcp-established&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's it. After this in the terminal you launched criu from you should see the continuing output of the tcp client.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[TCP connection]]&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Sockets]]&lt;/div&gt;</summary>
		<author><name>Ivinpolosony</name></author>
	</entry>
</feed>