File tree 4 files changed +43
-0
lines changed
4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ rm -rf ../dump/*
4
+ ../criu/criu/criu dump -v4 -t $( pgrep tcp_server) --images-dir ../dump/ --tcp-established -o dump.log
5
+
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ ../criu/criu/criu restore -v4 --images-dir ../dump/ --tcp-established -o restore.log
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import socket
4
+ import sys
5
+
6
+ HOST = 'localhost' # The server's hostname or IP address
7
+ PORT = 8888 # The port used by the server
8
+
9
+ with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
10
+ s .connect ((HOST , PORT ))
11
+ for line in sys .stdin :
12
+ s .sendall (line .encode ())
13
+ data = s .recv (1024 )
14
+ print ('Received' , repr (data ))
15
+
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import socket
4
+
5
+ PORT = 8888 # Port to listen on (non-privileged ports are > 1023)
6
+
7
+ with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
8
+ s .bind (('' , PORT ))
9
+ s .listen ()
10
+ print ("Testing something" )
11
+ while True :
12
+ conn , addr = s .accept ()
13
+ with conn :
14
+ print ('Connected by' , addr )
15
+ while True :
16
+ data = conn .recv (1024 )
17
+ if not data :
18
+ break
19
+ print ("Received %s" % data .decode ())
20
+ conn .sendall (data )
You can’t perform that action at this time.
0 commit comments