summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/sample
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2019-06-06 08:05:46 -0700
committerShentubot <shentubot@google.com>2019-06-06 08:07:02 -0700
commit85be01b42d4ac48698d1e8f50a4cf2607a4fc50b (patch)
tree18d58e55f9c21a177ed149d460f751649df7f0e5 /pkg/tcpip/sample
parent79f7cb6c1c4c16e3aca44d7fdc8e9f2487a605cf (diff)
Add multi-fd support to fdbased endpoint.
This allows an fdbased endpoint to have multiple underlying fd's from which packets can be read and dispatched/written to. This should allow for higher throughput as well as better scalability of the network stack as number of connections increases. Updates #231 PiperOrigin-RevId: 251852825
Diffstat (limited to 'pkg/tcpip/sample')
-rw-r--r--pkg/tcpip/sample/tun_tcp_connect/main.go2
-rw-r--r--pkg/tcpip/sample/tun_tcp_echo/main.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/sample/tun_tcp_connect/main.go b/pkg/tcpip/sample/tun_tcp_connect/main.go
index 1681de56e..1fa899e7e 100644
--- a/pkg/tcpip/sample/tun_tcp_connect/main.go
+++ b/pkg/tcpip/sample/tun_tcp_connect/main.go
@@ -137,7 +137,7 @@ func main() {
log.Fatal(err)
}
- linkID, err := fdbased.New(&fdbased.Options{FD: fd, MTU: mtu})
+ linkID, err := fdbased.New(&fdbased.Options{FDs: []int{fd}, MTU: mtu})
if err != nil {
log.Fatal(err)
}
diff --git a/pkg/tcpip/sample/tun_tcp_echo/main.go b/pkg/tcpip/sample/tun_tcp_echo/main.go
index 642607f83..d47085581 100644
--- a/pkg/tcpip/sample/tun_tcp_echo/main.go
+++ b/pkg/tcpip/sample/tun_tcp_echo/main.go
@@ -129,7 +129,7 @@ func main() {
}
linkID, err := fdbased.New(&fdbased.Options{
- FD: fd,
+ FDs: []int{fd},
MTU: mtu,
EthernetHeader: *tap,
Address: tcpip.LinkAddress(maddr),