github.com/rakyll/go@v0.0.0-20170216000551-64c02460d703/src/internal/poll/sockopt_windows.go (about)

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package poll
     6  
     7  import (
     8  	"syscall"
     9  )
    10  
    11  // Setsockopt wraps the Windows setsockopt network call.
    12  func (fd *FD) Setsockopt(level, optname int32, optval *byte, optlen int32) error {
    13  	if err := fd.incref(); err != nil {
    14  		return err
    15  	}
    16  	defer fd.decref()
    17  	return syscall.Setsockopt(fd.Sysfd, level, optname, optval, optlen)
    18  }
    19  
    20  // WSAIoctl wraps the Windows WSAIoctl call.
    21  func (fd *FD) WSAIoctl(iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *syscall.Overlapped, completionRoutine uintptr) error {
    22  	if err := fd.incref(); err != nil {
    23  		return err
    24  	}
    25  	defer fd.decref()
    26  	return syscall.WSAIoctl(fd.Sysfd, iocc, inbuf, cbif, outbuf, cbob, cbbr, overlapped, completionRoutine)
    27  }