- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for WithReadDeadline (0.18 sec)
-
internal/deadlineconn/deadlineconn.go
// Write - writes data to the connection. func (c *DeadlineConn) Write(b []byte) (n int, err error) { c.setWriteDeadline() n, err = c.Conn.Write(b) return n, err } // WithReadDeadline sets a new read side net.Conn deadline. func (c *DeadlineConn) WithReadDeadline(d time.Duration) *DeadlineConn { c.readDeadline = d return c } // WithWriteDeadline sets a new write side net.Conn deadline.
Go - Registered: Sun Apr 28 19:28:10 GMT 2024 - Last Modified: Sat Nov 05 18:09:21 GMT 2022 - 2.3K bytes - Viewed (0) -
internal/deadlineconn/deadlineconn_test.go
defer wg.Done() tcpConn, terr := tcpListener.AcceptTCP() if terr != nil { t.Errorf("failed to accept new connection. %v", terr) return } deadlineconn := New(tcpConn) deadlineconn.WithReadDeadline(time.Second) deadlineconn.WithWriteDeadline(time.Second) defer deadlineconn.Close() // Read a line b := make([]byte, 12) _, terr = deadlineconn.Read(b) if terr != nil {
Go - Registered: Sun Apr 28 19:28:10 GMT 2024 - Last Modified: Sat Nov 05 18:09:21 GMT 2022 - 3K bytes - Viewed (0) -
internal/http/listener.go
func (listener *httpListener) Accept() (conn net.Conn, err error) { select { case result, ok := <-listener.acceptCh: if ok { return deadlineconn.New(result.conn). WithReadDeadline(listener.opts.ClientReadTimeout). WithWriteDeadline(listener.opts.ClientWriteTimeout), result.err } case <-listener.ctx.Done(): } return nil, syscall.EINVAL }
Go - Registered: Sun Apr 21 19:28:08 GMT 2024 - Last Modified: Fri Mar 01 16:00:42 GMT 2024 - 5.8K bytes - Viewed (0)