mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 05:18:00 +00:00
zdtm/socket-tcp-closing: fill socket buffers effectivly
Send large chunks to fill socket buffers. Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
116e56ba46
commit
9d116b6878
@ -31,10 +31,13 @@ static int port = 8880;
|
|||||||
|
|
||||||
int fill_sock_buf(int fd)
|
int fill_sock_buf(int fd)
|
||||||
{
|
{
|
||||||
|
char zdtm[512];
|
||||||
int flags;
|
int flags;
|
||||||
int size;
|
int size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
memset(zdtm, 5, sizeof(zdtm));
|
||||||
|
|
||||||
flags = fcntl(fd, F_GETFL, 0);
|
flags = fcntl(fd, F_GETFL, 0);
|
||||||
if (flags == -1) {
|
if (flags == -1) {
|
||||||
pr_perror("Can't get flags");
|
pr_perror("Can't get flags");
|
||||||
@ -47,7 +50,6 @@ int fill_sock_buf(int fd)
|
|||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
char zdtm[] = "zdtm test packet";
|
|
||||||
ret = write(fd, zdtm, sizeof(zdtm));
|
ret = write(fd, zdtm, sizeof(zdtm));
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
if (errno == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user