Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for WithWriteDeadline (0.06 sec)

  1. internal/deadlineconn/deadlineconn_test.go

    		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 {
    			t.Errorf("failed to read from client. %v", terr)
    			return
    		}
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Mon Nov 11 17:15:17 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  2. internal/deadlineconn/deadlineconn.go

    // 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.
    func (c *DeadlineConn) WithWriteDeadline(d time.Duration) *DeadlineConn {
    	c.writeDeadline = d
    	return c
    }
    
    // New - creates a new connection object wrapping net.Conn with deadlines.
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Mon Dec 02 13:21:17 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  3. internal/http/listener.go

    	select {
    	case result := <-listener.acceptCh:
    		if result.err != nil {
    			return nil, result.err
    		}
    		return deadlineconn.New(result.conn).WithReadDeadline(listener.opts.IdleTimeout).WithWriteDeadline(listener.opts.IdleTimeout), result.err
    	case <-listener.ctxDoneCh:
    	}
    	return nil, syscall.EINVAL
    }
    
    // Close - closes underneath all TCP listeners.
    func (listener *httpListener) Close() (err error) {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 5.8K bytes
    - Viewed (0)
Back to top