Logo
Explore Help
Sign In
fluencelabs/tendermint
1
0
Fork 0
You've already forked tendermint
mirror of https://github.com/fluencelabs/tendermint synced 2025-05-19 10:01:18 +00:00
Code Issues Projects Releases Wiki Activity
tendermint/p2p/conn_go110.go

16 lines
377 B
Go
Raw Normal View History

p2p: use fake net.Pipe since only >=Go1.10 implements SetDeadline Fixes https://github.com/tendermint/tendermint/issues/851 Go1.9 and below's net.Pipe did not implement the SetDeadline method so after commit https://github.com/golang/go/commit/e2dd8ca946be884bb877e074a21727f1a685a706 this problem was exposed since now we check for errors. To counter this problem, implement a simple composition for net.Conn that always returns nil on SetDeadline instead of tripping out. Added build tags so that anyone using go1.10 when it is released will be able to automatically use net.Pipe's net.Conns
2017-11-14 21:49:08 -07:00
// +build go1.10
package p2p
// Go1.10 has a proper net.Conn implementation that
// has the SetDeadline method implemented as per
// https://github.com/golang/go/commit/e2dd8ca946be884bb877e074a21727f1a685a706
// lest we run into problems like
// https://github.com/tendermint/tendermint/issues/851
import "net"
func netPipe() (net.Conn, net.Conn) {
return net.Pipe()
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 51ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API