Skip to content

Commit a9df438

Browse files
committed
Add GetSysfd to conn type of net for getting sysfd for further use
1 parent 4a2bec9 commit a9df438

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/net/net.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ func (c *conn) ok() bool { return c != nil && c.fd != nil }
168168

169169
// Implementation of the Conn interface.
170170

171+
//Return sysfd for further use,like: syscall.SetsockoptTimeval
172+
func (c *conn) GetSysfd() int {
173+
return c.fd.pfd.Sysfd
174+
}
175+
171176
// Read implements the Conn Read method.
172177
func (c *conn) Read(b []byte) (int, error) {
173178
if !c.ok() {

0 commit comments

Comments
 (0)