-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
Go version
go version go1.22.0 linux/amd64
Output of go env in your module/workspace:
N/AWhat did you do?
I'm trying to write a tcp proxy that accepting connection from client and proxy it to another server. The proxy should:
- proxy data between client and server.
- relay
FINreceived from client to server and vice versa. - close both legs of connection once
RSTbeen received from either client or server.
What did you see happen?
I can send FIN by calling conn.CloseWrite() but I can't distinguish half-closed from closed tcp connection using conn.Read. All I got is io.EOF, I need to know whether it's half-closed or not so I can make decision to call conn.CloseWrite() or conn.Close().
Reading the source code indicate that the information is lost in src/runtime/netpoll_epoll.go: netpoll which checked syscall.EPOLLRDHUP with a bunch of other flags
What did you expect to see?
Able to wait for half-close and close event for tcp connection
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.