-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f82afb
commit 6999756
Showing
7 changed files
with
121 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//go:build linux | ||
|
||
package wait_stream | ||
|
||
import ( | ||
"golang.org/x/sys/unix" | ||
) | ||
|
||
func isSocketFdSendingBytes(fd int) (bool, error) { | ||
tcpInfo, err := unix.GetsockoptTCPInfo(fd, unix.IPPROTO_TCP, unix.TCP_INFO) | ||
if err != nil { | ||
return false, err | ||
} | ||
return tcpInfo.Notsent_bytes != 0, nil | ||
} |
9 changes: 2 additions & 7 deletions
9
...ckopt/is_sending_bytes_not_implemented.go → ...tream/is_sending_bytes_not_implemented.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
//go:build !linux | ||
|
||
package sockopt | ||
package wait_stream | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"net" | ||
) | ||
|
||
func isConnectionSendingBytesImplemented() bool { | ||
return false | ||
} | ||
|
||
func isConnectionSendingBytes(_ *net.TCPConn) (bool, error) { | ||
func isSocketFdSendingBytes(_ int) (bool, error) { | ||
return false, fmt.Errorf("%w: checking if socket is sending bytes is not implemented on this platform", errors.ErrUnsupported) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters