From a9df4389b1ebead51f32dca756b0db2853501033 Mon Sep 17 00:00:00 2001 From: sandyskies Date: Tue, 5 Jun 2018 15:09:35 +0800 Subject: [PATCH] Add GetSysfd to conn type of net for getting sysfd for further use --- src/net/net.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/net/net.go b/src/net/net.go index 48c500167052c2..5839c062a8ba2a 100644 --- a/src/net/net.go +++ b/src/net/net.go @@ -168,6 +168,11 @@ func (c *conn) ok() bool { return c != nil && c.fd != nil } // Implementation of the Conn interface. +//Return sysfd for further use,like: syscall.SetsockoptTimeval +func (c *conn) GetSysfd() int { + return c.fd.pfd.Sysfd +} + // Read implements the Conn Read method. func (c *conn) Read(b []byte) (int, error) { if !c.ok() {