Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and deadline support. MIT Licensed.

Related tags

Network socket
Overview

socket Test Status Go Reference Go Report Card

Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and deadline support. MIT Licensed.

This package focuses on UNIX-like operating systems which make use of BSD sockets system call APIs. It is meant to be used as a foundation for the creation of operating system-specific socket packages, for socket families such as Linux's AF_NETLINK, AF_PACKET, or AF_VSOCK. This package should not be used directly in end user applications.

Any use of package socket should be guarded by build tags, as one would also use when importing the syscall or golang.org/x/sys packages.

You might also like...
wire protocol for multiplexing connections or streams into a single connection, based on a subset of the SSH Connection Protocol

qmux qmux is a wire protocol for multiplexing connections or streams into a single connection. It is based on the SSH Connection Protocol, which is th

CoreRAD is an extensible and observable IPv6 Neighbor Discovery Protocol router advertisement daemon. Apache 2.0 Licensed.
CoreRAD is an extensible and observable IPv6 Neighbor Discovery Protocol router advertisement daemon. Apache 2.0 Licensed.

CoreRAD CoreRAD is an extensible and observable IPv6 Neighbor Discovery Protocol router advertisement daemon. Apache 2.0 Licensed. To get started with

A go module supply Java-Like generic stream programming (while do type check at runtime)

gostream A go module supplying Java-Like generic stream programming (while do type check at runtime) Using Get a Stream To get a Stream, using SliceSt

Gsshrun - Running commands via ssh on the server/hosting (if ssh support) specified in the connection file

Gsshrun - Running commands via ssh on the server/hosting (if ssh support) specified in the connection file

Make TCP connection storm between server and client for benchmarking network stuff

Make TCP connection storm between server and client for benchmarking network stuff

Send network packets over a TCP or UDP connection.

Packet is the main class representing a single network message. It has a byte code indicating the type of the message and a []byte type payload.

Subdomain scanner, asynchronous dns packets, use pcap to scan 1600,000 subdomains in 1 second

ksubdomain是一款基于无状态的子域名爆破工具,类似无状态端口扫描,支持在Windows/Linux/Mac上进行快速的DNS爆破,在Mac和Windows上理论最大发包速度在30w/s,linux上为160w/s。 hacking8信息流的src资产收集 https://i.hacking8

Fastest python library for making asynchronous group requests.

FGrequests: Fastest Asynchronous Group Requests Installation Install using pip: pip install fgrequests Documentation Pretty easy to use. import fgrequ

Crimson prober - Asynchronous TCP scanner through SOCKS5 proxies
Crimson prober - Asynchronous TCP scanner through SOCKS5 proxies

Crimson Prober v1 Alpha version of Asynchronous TCP scanner through SOCKS5 proxi

Comments
  • TestLinuxDialVsockNoListener test failure

    TestLinuxDialVsockNoListener test failure

    OS: Debian sid/amd64 golang: go1.17.8 linux/amd64 github.com/mdlayher/socket: v0.2.2

    I am working on updating the version of this library that's packaged for Debian, but the TestLinuxDialVsockNoListener test always fails. I see this failure via go test (below), well as in the schroot environment that is created when building the Debian package. My build setup is a minimal Debian sid install that is running within a privileged LXD container.

    [email protected]:~/golang-github-mdlayher-socket$ go test
    go: downloading golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
    go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
    go: downloading golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7
    go: downloading github.com/google/go-cmp v0.5.7
    --- FAIL: TestLinuxDialVsockNoListener (0.00s)
        conn_linux_test.go:149: unexpected connect error (-want +got):
              any(
            - 	e"connect: connection reset by peer",
              )
    FAIL
    exit status 1
    FAIL	github.com/mdlayher/socket	0.445s
    
    opened by gibmat 5
  • Missing error check in socket fallback path

    Missing error check in socket fallback path

    The unix.Socket call in EINVAL or EPROTONOSUPPORT fallback path in socket is missing the error check:

    https://github.com/mdlayher/socket/blob/7c9fcbcebf504a63e5d002868c514b6bb97708ba/conn.go#L197-L204

    That means if unix.Socket fails with EINVAL or EPROTONOSUPPORT and then fails again, a *Conn will be returned referencing fd=0 / /dev/stdin.

    opened by tmthrgd 1
  • socket: use generics to simplify closure value returns

    socket: use generics to simplify closure value returns

    I started experimenting with this in https://github.com/mdlayher/socket/commit/247e85df156379823e7f10b96c503a87f79a452b.

    Eventually we can make a lot of calls return (T, error) from closures to simplify the need to pass variables in and out, and to remove the hassle of dealing with multiple error scopes.

    However, since this is a very foundational library and generics are very new, it probably isn't feasible to do this for some time. It'd be possible to add Go 1.18+ shims and duplicate the code, but that doesn't seem great either.

    opened by mdlayher 0
Releases(v0.4.0)
Owner
Matt Layher
Software Engineer. Go, Linux, and open source software enthusiast. On and ever upward.
Matt Layher
Package ethernet implements marshaling and unmarshaling of IEEE 802.3 Ethernet II frames and IEEE 802.1Q VLAN tags. MIT Licensed.

ethernet Package ethernet implements marshaling and unmarshaling of IEEE 802.3 Ethernet II frames and IEEE 802.1Q VLAN tags. MIT Licensed. For more in

Matt Layher 246 Nov 9, 2022
Package arp implements the ARP protocol, as described in RFC 826. MIT Licensed.

arp Package arp implements the ARP protocol, as described in RFC 826. MIT Licensed. Portions of this code are taken from the Go standard library. The

Matt Layher 300 Nov 10, 2022
Package dhcp6 implements a DHCPv6 server, as described in RFC 3315. MIT Licensed.

dhcp6 Package dhcp6 implements a DHCPv6 server, as described in IETF RFC 3315. MIT Licensed. At this time, the API is not stable, and may change over

Matt Layher 76 Sep 27, 2022
Gos: Armed Golang 💪 ( solutions for go module, goproxy, cross compilation, etc.)

The current gos is still an alpha version, welcome more heroes to comment and improve it ?? , you can add more commands to it, or modify something to make it perform better.

storyicon 373 Sep 15, 2022
GOWS is GoLang web-socket module Provides you with ease of handling web socket connections with a few lines

GOWS GOWS is GoLang web-socket module Provides you with ease of handling web socket connections with a few lines, it supports multi-connection on one

null 6 Apr 4, 2022
Curtis Milo 2 May 8, 2022
Simple Relay between a Unix socket and a TCP socket, and vice versa.

Simple TCP <-> Unix Relay simpletcpunixrelay is a program which exposes a TCP endpoint as a Unix socket and vice versa. Usecase Let's say you are runn

Antoine Catton 0 Dec 4, 2021
Glue - Robust Go and Javascript Socket Library (Alternative to Socket.io)

Glue - Robust Go and Javascript Socket Library Glue is a real-time bidirectional socket library. It is a clean, robust and efficient alternative to so

DesertBit 408 Nov 25, 2022
Go network programming framework, supports multiplexing, synchronous and asynchronous IO mode, modular design, and provides flexible custom interfaces

Go network programming framework, supports multiplexing, synchronous and asynchronous IO mode, modular design, and provides flexible custom interfaces。The key is the transport layer, application layer protocol has nothing to do

rick.wu 11 Nov 7, 2022