code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // DNS packet assembly. See RFC 1035. // // This is intended to support name resolution during Dial. // It doesn't have to be blazing fast. // // Each message ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Unix domain sockets stubs for Plan 9 package net import ( "syscall" "time" ) // UnixConn is an implementation of the Conn interface // for connections ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP address manipulations // // IPv4 addresses are 4 bytes; IPv6 addresses are 16 bytes. // An IPv4 address can be converted to an IPv6 address by // adding a...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "os" "syscall" ) // FileConn returns a copy of the network connection corresponding to // the open file f. It is the caller's responsi...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "time" ) func parseDialNetwork(net string) (afnet string, proto int, err error) { i := last(net, ':') if i < 0 { // no colon switch...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via kqueue/kevent. package net import ( "os" "syscall" ) type pollster struct { kq int eventbuf [10]syscall.Kevent_t events [...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows // (Raw) IP sockets package net import ( "os" "syscall" "time" ) func sockaddrToIP(sa syscall.Sock...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Read static host/IP entries from /etc/hosts. package net import ( "sync" "time" ) const cacheMaxAge = 5 * time.Minute // hostsPath points to the file w...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for Darwin package net import ( "os" "syscall" ) // If the ifindex is zero, interfaceMulticastAddrTable returns // add...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "io" "os" "syscall" ) // maxSendfileSize is the largest chunk size we ask the kernel to copy // at a time. const maxSendfileSize int ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP-level socket options for Darwin package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.inc...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows package net import "syscall" // Should we try to use the IPv4 socket interface if we're // only dealin...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows // Unix domain sockets package net import ( "os" "syscall" "time" ) func unixSocket(net string, la...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP-level socket options for Linux package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.incr...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd package net import ( "os" "syscall" ) func newPollServer() (s *pollServer, err error) { s = new(pollServer) ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification package net import "errors" var ( errInvalidInterface = errors.New("net: invalid interface") errInvalidInterfa...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd package net import "io" func sendFile(c *netFD, r io.Reader) (n int64, err error, handled bool) { return 0, nil, fa...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows // Sockets package net import ( "io" "syscall" ) var listenerBacklog = maxListenerBacklog() // Gen...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows // Socket options package net import ( "os" "syscall" "time" ) // Boolean to int. func boolint(b b...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP sockets stubs for Plan 9 package net import ( "errors" "io" "os" "syscall" "time" ) // probeIPv6Stack returns two boolean values. If the first b...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd // Network interface identification for BSD variants package net import ( "os" "syscall" "unsafe" ) // If the if...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows // UDP sockets package net import ( "errors" "os" "syscall" "time" ) var ErrWriteToConnected = er...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for Windows package net import ( "os" "syscall" "unsafe" ) func bytePtrToString(p *uint8) string { a := (*[10000]uin...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bufio" "bytes" "errors" "fmt" "io" "io/ioutil" "net/textproto" "strconv" "strings" ) // transferWriter inspects the fields of ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP file system request handler package http import ( "errors" "fmt" "io" "mime" "os" "path" "path/filepath" "strconv" "strings" "time" ) // A ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package pprof serves via its HTTP server runtime profiling data // in the format expected by the pprof visualization tool. // For more information about ppr...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "fmt" "io" "net/textproto" "sort" "strings" ) // A Header represents the key-value pairs in an HTTP header. type Header map[string...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP Response reading and parsing. package http import ( "bufio" "errors" "io" "net/textproto" "net/url" "strconv" "strings" ) var respExcludeHeade...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "fmt" "io" ) // fileTransport implements RoundTripper for the 'file' protocol. type fileTransport struct { fh fileHandler } // NewFi...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The wire protocol for HTTP's "chunked" Transfer-Encoding. // This code is duplicated in httputil/chunked.go. // Please make any changes in both files. pack...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httptest provides utilities for HTTP testing. package httptest import ( "bytes" "net/http" ) // ResponseRecorder is an implementation of http.Res...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Implementation of Server package httptest import ( "crypto/tls" "flag" "fmt" "net" "net/http" "os" "sync" ) // A Server is an HTTP server listening...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements CGI from the perspective of a child // process. package cgi import ( "bufio" "crypto/tls" "errors" "fmt" "io" "io/ioutil" "net"...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements the host side of CGI (being the webserver // parent process). // Package cgi implements CGI (Common Gateway Interface) as specified // ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http // HTTP status codes, defined in RFC 2616. const ( StatusContinue = 100 StatusSwitchingProtocols = 101 StatusOK = ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "bytes" "expvar" "flag" "fmt" "io" "log" "net/http" "os" "os/exec" "strconv" "sync" ) // hello world, the w...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP Request reading and parsing. package http import ( "bufio" "bytes" "crypto/tls" "encoding/base64" "errors" "fmt" "io" "io/ioutil" "mime" "mi...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http // This file deals with lexical matters of HTTP func isSeparator(c byte) bool { switch c { case '(', ')', '<', '>', '@', ',', ';', ':', '\\', '...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bytes" "fmt" "strconv" "strings" "time" ) // This implementation is done according to RFC 6265: // // http://tools.ietf.org/htm...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bytes" "encoding/binary" ) // The algorithm uses at most sniffLen bytes to make its decision. const sniffLen = 512 // DetectContent...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP client implementation. See RFC 2616. // // This is the low-level Transport implementation of RoundTripper. // The high-level interface is in client.go....
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fcgi // This file implements FastCGI from the perspective of a child process. import ( "errors" "fmt" "io" "net" "net/http" "net/http/cgi" "os"...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package fcgi implements the FastCGI protocol. // Currently only the responder role is supported. // The protocol is defined at http://www.fastcgi.com/drupal/...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP server. See RFC 2616. // TODO(rsc): // logging package http import ( "bufio" "bytes" "crypto/tls" "errors" "fmt" "io" "io/ioutil" "log" "ne...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httputil provides HTTP utility functions, complementing the // more common ones in the net/http package. package httputil import ( "bufio" "errors...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The wire protocol for HTTP's "chunked" Transfer-Encoding. // This code is a duplicate of ../chunked.go with these edits: // s/newChunked/NewChunked/g // s/p...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP reverse proxy handler package httputil import ( "io" "log" "net" "net/http" "net/url" "strings" "sync" "time" ) // ReverseProxy is an HTTP Ha...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httputil import ( "bufio" "bytes" "fmt" "io" "io/ioutil" "net" "net/http" "net/url" "strings" "time" ) // One of the copies, say from b to r...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package http provides HTTP client and server implementations. Get, Head, Post, and PostForm make HTTP requests: resp, err := http.Get("http://example.com/...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "net/url" ) // A CookieJar manages storage and use of cookies in HTTP requests. // // Implementations of CookieJar must be safe for co...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP client. See RFC 2616. // // This is the high-level Client interface. // The low-level implementation is in transport.go. package http import ( "enco...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for NetBSD package net // If the ifindex is zero, interfaceMulticastAddrTable returns // addresses for all network interf...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP-level socket options for OpenBSD package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.in...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd // Read system DNS config from /etc/resolv.conf package net type dnsConfig struct { servers []string // serve...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Sockets for Windows package net import "syscall" func maxListenerBacklog() int { // TODO: Implement this return syscall.SOMAXCONN } func listenerSocka...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // UDP sockets package net // UDPAddr represents the address of a UDP end point. type UDPAddr struct { IP IP Port int } // Network returns the address's...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // (Raw) IP sockets package net // IPAddr represents the address of a IP end point. type IPAddr struct { IP IP } // Network returns the address's network n...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for Linux package net import ( "os" "syscall" "unsafe" ) // If the ifindex is zero, interfaceTable returns mappings o...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "os" "sync" "syscall" "unsafe" ) var ( protoentLock sync.Mutex hostentLock sync.Mutex serventLock sync.Mutex ) // lookupProtoco...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd package net import ( "errors" "sync" ) var ( protocols map[string]int onceReadProtocols sync.Once ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via epoll(7). package net import ( "os" "syscall" ) const ( readFlags = syscall.EPOLLIN | syscall.EPOLLRDHUP writeFlags = syscall.EPO...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TCP sockets package net // TCPAddr represents the address of a TCP end point. type TCPAddr struct { IP IP Port int } // Network returns the address's...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // MAC address manipulations package net import "errors" const hexDigit = "0123456789abcdef" // A HardwareAddr represents a physical hardware address. type...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package mail implements parsing of mail messages. For the most part, this package follows the syntax as specified by RFC 5322. Notable divergences: * Obsol...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Socket options for Linux package net import ( "os" "syscall" ) func setDefaultSockopts(s, f, t int, ipv6only bool) error { switch f { case syscall.AF...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net /* #include <netdb.h> */ import "C" func cgoAddrInfoMask() C.int { return C.AI_CANONNAME | C.AI_V4MAPPED | C.AI_ALL }
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "errors" "io" "os" "runtime" "sync" "syscall" "time" "unsafe" ) var initErr error func init() { var d syscall.WSAData e := sys...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP-level socket options for Windows package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { // TODO: Implem...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP-level socket options for NetBSD package net import "syscall" func ipv4MulticastInterface(fd *netFD) (*Interface, error) { // TODO: Implement this re...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd package net import ( "errors" "io" "os" "sync" "syscall" "time" ) // Network file descriptor. type netFD ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build plan9 // Network interface identification package net // If the ifindex is zero, interfaceTable returns mappings of all // network interfaces. Ot...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd package net /* #include <netdb.h> */ import "C" func cgoAddrInfoMask() C.int { return C.AI_MASK }
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd // Socket options for BSD variants package net import ( "os" "syscall" ) func setDefaultSockopts(s, f, t int, ipv...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows // IP-level socket options package net import ( "os" "syscall" ) func ipv4TOS(fd *netFD) (int, erro...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd // Read system port mappings from /etc/services package net import "sync" var services map[string]map[string]i...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "errors" "io" "time" ) // Pipe creates a synchronous, in-memory, full duplex // network connection; both ends implement the Conn inte...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "math/rand" "sort" ) // DNSError represents a DNS lookup error. type DNSError struct { Err string // description of the error N...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "os" "syscall" ) func FileConn(f *os.File) (c Conn, err error) { // TODO: Implement this return nil, os.NewSyscallError("FileConn", s...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via kqueue/kevent. package net import ( "os" "syscall" ) type pollster struct { kq int eventbuf [10]syscall.Kevent_t events [...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package net provides a portable interface for network I/O, including TCP/IP, UDP, domain name resolution, and Unix domain sockets. Although the package prov...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package textproto import ( "sync" ) // A Pipeline manages a pipelined in-order request/response sequence. // // To use a Pipeline p to manage multiple clien...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package textproto // A MIMEHeader represents a MIME-style header mapping // keys to sets of values. type MIMEHeader map[string][]string // Add adds the key, ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package textproto import ( "bufio" "fmt" "io" ) // A Writer implements convenience methods for writing // requests or responses to a text protocol network...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package textproto import ( "bufio" "bytes" "io" "io/ioutil" "strconv" "strings" ) // BUG(rsc): To let callers manage exposure to denial of service // a...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package textproto implements generic support for text-based request/response // protocols in the style of HTTP, NNTP, and SMTP. // // The package provides: ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP-level socket options for FreeBSD package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.in...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd // Sockets for BSD variants package net import ( "runtime" "syscall" ) func maxListenerBacklog() int { var ( n...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via kqueue/kevent. package net import ( "os" "syscall" ) type pollster struct { kq int eventbuf [10]syscall.Kevent_t events [...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "io" "os" "syscall" ) type sendfileOp struct { anOp src syscall.Handle // source n uint32 } func (o *sendfileOp) Submit() (err ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP sockets package net var supportsIPv6, supportsIPv4map = probeIPv6Stack() func firstFavoriteAddr(filter func(IP) IP, addrs []string) (addr IP) { if fi...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd // DNS client: see RFC 1035. // Has to be linked into package net for Dial. // TODO(rsc): // Check periodically ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for OpenBSD package net // If the ifindex is zero, interfaceMulticastAddrTable returns // addresses for all network inter...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd // IP-level socket options for BSD variants package net import ( "os" "syscall" ) func ipv4MulticastTTL(fd *netFD...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // (Raw) IP sockets stubs for Plan 9 package net import ( "syscall" "time" ) // IPConn is the implementation of the Conn and PacketConn // interfaces for ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd package net import ( "os" "syscall" ) func newFileFD(f *os.File) (*netFD, error) { fd, err := syscall.Dup(in...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Unix domain sockets package net // UnixAddr represents the address of a Unix domain socket end point. type UnixAddr struct { Name string Net string } ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package url parses URLs and implements query escaping. // See RFC 3986. package url import ( "errors" "strconv" "strings" ) // Error reports an error an...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !cgo // Stub cgo routines for systems that do not use cgo to do network lookups. package net func cgoLookupHost(name string) (addrs []string, err ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Sockets for Linux package net import "syscall" func maxListenerBacklog() int { fd, err := open("/proc/sys/net/core/somaxconn") if err != nil { return...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Simple file i/o and string manipulation, to avoid // depending on strconv and bufio and strings. package net import ( "io" "os" ) type file struct { fi...
Go