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. // +build plan9 package os func itoa(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + itoa(-val) } var ...
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 sql provides a generic interface around SQL (or SQL-like) // databases. package sql import ( "database/sql/driver" "errors" "fmt" "io" "sync" )...
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 driver import ( "fmt" "reflect" "strconv" "time" ) // ValueConverter is the interface providing the ConvertValue method. // // Various implementat...
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 driver defines interfaces to be implemented by database // drivers as used by package sql. // // Most code should use package sql. package driver im...
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. // Type conversions for Scan. package sql import ( "database/sql/driver" "errors" "fmt" "reflect" "strconv" ) // subsetTypeArgs takes a slice of argumen...
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. // Pipe adapter to connect code expecting an io.Reader // with code expecting an io.Writer. package io import ( "errors" "sync" ) // ErrClosedPipe is the e...
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 io type multiReader struct { readers []Reader } func (mr *multiReader) Read(p []byte) (n int, err error) { for len(mr.readers) > 0 { n, err = mr.r...
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 ioutil import ( "os" "path/filepath" "strconv" "time" ) // Random number state, accessed without lock; racy but harmless. // We generate random t...
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 ioutil implements some I/O utility functions. package ioutil import ( "bytes" "io" "os" "sort" ) // readAll reads from r until an error or EOF ...
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 io provides basic interfaces to I/O primitives. // Its primary job is to wrap existing implementations of such primitives, // such as those in packag...
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 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. // +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. // 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. // UDP for Plan 9 package net import ( "errors" "os" "syscall" "time" ) // UDPConn is the implementation of the Conn and PacketConn // interfaces for UD...
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. // 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 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 // TCP sockets package net import ( "io" "os" "syscall" "time" ) // BUG(rsc): On OpenBSD, listeni...
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 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 smtp import ( "crypto/hmac" "crypto/md5" "errors" "fmt" ) // Auth is implemented by an SMTP authentication mechanism. type Auth interface { // St...
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 smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321. // It also implements the following extensions: // 8BITMIME RFC 1652 // AU...
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 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. // 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 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 Windows package net import ( "os" "syscall" "unsafe" ) func bytePtrToString(p *uint8) string { a := (*[10000]uin...
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 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 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 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 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 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 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 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. // +build darwin freebsd linux netbsd openbsd windows // Base posix socket functions. package net import ( "os" "syscall" "time" ) type conn struct { f...
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 ( "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 Linux package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.incr...
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 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 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. // Network interface identification for Linux package net import ( "os" "syscall" "unsafe" ) // If the ifindex is zero, interfaceTable returns mappings o...
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 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. // +build darwin freebsd linux netbsd openbsd windows // UDP sockets package net import ( "errors" "syscall" ) var ErrWriteToConnected = errors.New("use ...
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 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 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 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. // HTTP reverse proxy handler package httputil import ( "io" "log" "net" "net/http" "net/url" "strings" "sync" "time" ) // onExitFlushLoop is a callb...
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 client implementation. See RFC 2616. // // This is the low-level Transport implementation of RoundTripper. // The high-level interface is in client.go....
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 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 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 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 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 server. See RFC 2616. // TODO(rsc): // logging package http import ( "bufio" "bytes" "crypto/tls" "errors" "fmt" "io" "io/ioutil" "log" "ne...
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. // Package httptest provides utilities for HTTP testing. package httptest import ( "bytes" "net/http" ) // ResponseRecorder is an implementation of http.Res...
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. // 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 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 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. // +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. package http // This file deals with lexical matters of HTTP var isTokenTable = [127]bool{ '!': true, '#': true, '$': true, '%': true, '&': true, '...
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 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. 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. package http import ( "fmt" "io" ) // fileTransport implements RoundTripper for the 'file' protocol. type fileTransport struct { fh fileHandler } // NewFi...
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. // IP-level socket options for Darwin package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.inc...
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 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 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. package net // LookupHost looks up the given host using the local resolver. // It returns an array of that host's addresses. func LookupHost(host string) (add...
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 for Plan 9 package net import ( "syscall" "time" ) // TCPConn is an implementation of the Conn interface // for TCP network connections. type TCPCo...
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. // Package url parses URLs and implements query escaping. // See RFC 3986. package url import ( "errors" "strconv" "strings" ) // Error reports an error an...
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 rpc provides access to the exported methods of an object across a network or other I/O connection. A server registers an object, making it visible...
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 jsonrpc import ( "encoding/json" "errors" "io" "net/rpc" "sync" ) type serverCodec struct { dec *json.Decoder // for reading JSON values enc *...
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 jsonrpc implements a JSON-RPC ClientCodec and ServerCodec // for the rpc package. package jsonrpc import ( "encoding/json" "fmt" "io" "net" "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. package rpc import ( "bufio" "encoding/gob" "errors" "io" "log" "net" "net/http" "sync" ) // ServerError represents an error that has been returned fr...
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 rpc /* Some HTML presented at http://machine:port/debug/rpc Lists services, their methods, and some statistics, still rudimentary. */ import ( "fmt...
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 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 ( "errors" "os" "syscall" ) func query(filename, query string, bufSize int) (res []string, err error) { file, err := os.OpenFile(filen...
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 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" ) type sendfileOp struct { anOp src syscall.Handle // source n uint32 } func (o *sendfileOp) Submit() (err ...
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 Windows package net import ( "os" "syscall" ) func setDefaultSockopts(s syscall.Handle, f, t int, ipv6only bool) error { switch f {...
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 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 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 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 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. // 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 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 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 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