Skip to content

prep/socketpair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

socketpair TravisCI Go Report Card GoDoc

This is a simple package for Go that provides an interface to socketpair(2).

Usage

import "github.com/prep/socketpair"
func testSocketPair() error {
    sock1, sock2, err := socketpair.New("unix")
    if err != nil {
        return err
    }

    defer sock1.Close()
    defer sock2.Close()

    if _, err := sock1.Write([]byte("Hello World")); err != nil {
        return err
    }

    data := make([]byte, 11)
    if _, err := sock2.Read(data); err != nil {
        return err
    }

    return nil
}

License

This software is distributed under the BSD-style license found in the LICENSE file.

About

A socketpair interface for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages