https://github.com/lestrrat-go/tcputil
Some Utilities To Help Your TCP-Related testing
https://github.com/lestrrat-go/tcputil
Last synced: 2 months ago
JSON representation
Some Utilities To Help Your TCP-Related testing
- Host: GitHub
- URL: https://github.com/lestrrat-go/tcputil
- Owner: lestrrat-go
- License: mit
- Created: 2014-01-29T02:05:33.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-02-23T00:36:07.000Z (over 7 years ago)
- Last Synced: 2024-06-19T00:32:00.834Z (about 1 year ago)
- Language: Go
- Size: 4.88 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tcputil
==========Some Utilities To Help Your TCP-Related testing
[](https://travis-ci.org/lestrrat-go/tcputil)
[](https://godoc.org/github.com/lestrrat-go/tcputil)# SYNOPSIS
```go
p, err := EmptyPort()
if err != nil {
log.Fatal(err)
}cmd := exec.Command("memcached", "-p", fmt.Sprintf("%d", p))
go cmd.Run()err = WaitLocalPort(p, 30 * time.Second)
if err != nil {
log.Fatal(err)
}// Now do whatever with memcached!
cmd.Process.Kill()
```For a higher level wrapper for testing network servers on random local ports,
see [go-tcptest](https://github.com/lestrrat-go/tcptest)API docs: http://godoc.org/github.com/lestrrat-go/tcputil