You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to half close on the hijacked connection? I am trying to signal that I am done writing to stdin:
sort
1
2
3
// Here you would ^D
Code:
conn, err:=s.docker.ContainerExecCreate(context.Background(), resp.ID, types.ExecConfig{
Cmd: "sort",
AttachStdout: true,
AttachStderr: true,
AttachStdin: true,
Tty: false,
})
iferr!=nil {
panic(err)
}
err=conn.Conn.Write([]byte("3\r\n5\r\n1\r\n")) // I dont pass it in the first CMD as ideally I'd build this dynamicallyiferr!=nil {
panic(err)
}
// Here I would like to signal my command is complete without closing the conn to readers
However, this timeouts in a test, my initial guess is because of the lack of an EOF to signal that I am done writing to stdin, which does not trigger the usual ^D one would send when doing this in the terminal.
Also, if I closed the connection, I would not be able to grab the result as the reader would error from the connection being closed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it possible to half close on the hijacked connection? I am trying to signal that I am done writing to stdin:
Code:
However, this timeouts in a test, my initial guess is because of the lack of an EOF to signal that I am done writing to stdin, which does not trigger the usual
^D
one would send when doing this in the terminal.Also, if I closed the connection, I would not be able to grab the result as the reader would error from the connection being closed.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions