Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for testSendFile (0.11 sec)

  1. src/os/writeto_linux_test.go

    	"net"
    	. "os"
    	"strconv"
    	"syscall"
    	"testing"
    	"time"
    )
    
    func TestSendFile(t *testing.T) {
    	sizes := []int{
    		1,
    		42,
    		1025,
    		syscall.Getpagesize() + 1,
    		32769,
    	}
    	t.Run("sendfile-to-unix", func(t *testing.T) {
    		for _, size := range sizes {
    			t.Run(strconv.Itoa(size), func(t *testing.T) {
    				testSendFile(t, "unix", int64(size))
    			})
    		}
    	})
    	t.Run("sendfile-to-tcp", func(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. src/net/sendfile_test.go

    		t.Error("internal/poll.SendFile did not handle the write, want it to")
    		return
    	}
    	if &wantConn.(*TCPConn).fd.pfd != gotFD {
    		t.Error("internal.poll.SendFile called with unexpected FD")
    	}
    }
    
    func TestSendfile(t *testing.T) {
    	ln := newLocalListener(t, "tcp")
    	defer ln.Close()
    
    	errc := make(chan error, 1)
    	go func(ln Listener) {
    		// Wait for a connection.
    		conn, err := ln.Accept()
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 12.1K bytes
    - Viewed (0)
Back to top