]> Cypherpunks repositories - gostls13.git/commit
net: test net.FileConn and net.FileListener with UDP sockets on wasip1
authorAchille Roussel <achille.roussel@gmail.com>
Sat, 10 Jun 2023 19:44:21 +0000 (12:44 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 12 Jun 2023 23:11:39 +0000 (23:11 +0000)
commit0b5a4afec9df67157891732e5ca660eaf1efab34
tree1650874beeb5dd33235aa3dea651d039bcbbf068
parentd22b08bd6449806a300f3e4c5514cdbcbc97c57f
net: test net.FileConn and net.FileListener with UDP sockets on wasip1

The WASI specification has file types for both stream and datagram
sockets. This change refactors the internal implementation of the
net.FileConn and net.FileListener functions to avoid returning a
misleading ENOTSOCK when calling net.FileConn with a file referencing
a datagram socket and instead properly construct net.UDPConn values
or return EOPNOTSUPP otherwise.

Change-Id: I594f700847254895cd6ce172979fd89c4b851940
Reviewed-on: https://go-review.googlesource.com/c/go/+/502316
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
src/net/fd_wasip1.go
src/net/file_wasip1.go
src/net/file_wasip1_test.go [new file with mode: 0644]