Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
add deadline methods to stream
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Nov 8, 2016
1 parent d1b6fd6 commit a3b46bf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"gxDependencies": [
{
"author": "whyrusleeping",
"hash": "QmdysBu77i3YaagNtMAjiCJdeWWvds18ho5XEB784guQ41",
"hash": "QmU3pGGVT1riXp5dBJbNrGpxssVScfvk9236drRHZZbKJ1",
"name": "go-libp2p-net",
"version": "1.5.0"
"version": "1.6.0"
},
{
"author": "whyrusleeping",
Expand Down Expand Up @@ -39,21 +39,21 @@
},
{
"author": "whyrusleeping",
"hash": "QmfXgTygwsTPyUWPWTAeBK6cFtTdMqmeeqhyhcNMhRpT1g",
"hash": "QmWUNsat6Jb19nC5CiJCDXepTkxjdxi3eZqeoB6mrmmaGu",
"name": "go-smux-spdystream",
"version": "1.1.1"
"version": "1.2.0"
},
{
"author": "whyrusleeping",
"hash": "QmetupZ62uEdoqNsbZUCgqU3JyfssExBfqBwBhDpjyE6eW",
"hash": "QmTfjLsou9ic6L4KqCcmbLSZcdiFu8q1v6njKp121pbbXx",
"name": "go-smux-multistream",
"version": "1.4.0"
"version": "1.5.0"
},
{
"author": "whyrusleeping",
"hash": "QmSHTSkxXGQgaHWz91oZV3CDy3hmKmDgpjbYRT6niACG4E",
"hash": "Qmbn7RYyWzBVXiUp9jZ1dA4VADHy9DtS7iZLwfhEUQvm3U",
"name": "go-smux-yamux",
"version": "1.1.1"
"version": "1.2.0"
},
{
"author": "whyrusleeping",
Expand All @@ -69,15 +69,15 @@
},
{
"author": "whyrusleeping",
"hash": "QmS9en3mcwW2HRSeRabceJEGVxTZF4vEeFm7JHWQwWsb1U",
"hash": "QmVwFjMdejJ8mGVmgyR2mKcUHrvNBDtDsKRT99soVbkFhA",
"name": "go-peerstream",
"version": "1.4.1"
"version": "1.5.0"
},
{
"author": "whyrusleeping",
"hash": "QmVcNzHewFvmVah1CGqg8NV7nHHsPu19U43YE5b2oqWyBp",
"hash": "QmX4j1JhubdEt4EB1JY1mMKTvJwPZSRzTv3uwh5zaDqyAi",
"name": "go-libp2p-metrics",
"version": "1.5.0"
"version": "1.6.0"
},
{
"author": "whyrusleeping",
Expand Down
15 changes: 14 additions & 1 deletion swarm_stream.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package swarm

import (
"time"

inet "github.com/libp2p/go-libp2p-net"
protocol "github.com/libp2p/go-libp2p-protocol"

ps "github.com/libp2p/go-peerstream"
)

Expand Down Expand Up @@ -49,3 +50,15 @@ func (s *Stream) Protocol() protocol.ID {
func (s *Stream) SetProtocol(p protocol.ID) {
(*ps.Stream)(s).SetProtocol(p)
}

func (s *Stream) SetDeadline(t time.Time) error {
return s.Stream().SetDeadline(t)
}

func (s *Stream) SetReadDeadline(t time.Time) error {
return s.Stream().SetReadDeadline(t)
}

func (s *Stream) SetWriteDeadline(t time.Time) error {
return s.Stream().SetWriteDeadline(t)
}

0 comments on commit a3b46bf

Please sign in to comment.