Skip to content

Commit

Permalink
Merge pull request #54 from libp2p/feat/wasm
Browse files Browse the repository at this point in the history
Support WASM
  • Loading branch information
Stebalien authored Dec 28, 2018
2 parents 8cfd5f2 + db3a203 commit f92c31f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ os:

language: go
go:
- 1.10.x
- 1.11.x

install:
- make deps
Expand Down
28 changes: 28 additions & 0 deletions impl_wasm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package reuseport

import (
"context"
"net"
)

// TODO. for now, just pass it over to net.Listen/net.Dial

func listen(network, address string) (net.Listener, error) {
return net.Listen(network, address)
}

func listenPacket(netw, laddr string) (net.PacketConn, error) {
return net.ListenPacket(netw, laddr)
}

func listenStream(netw, addr string) (net.Listener, error) {
return listen(netw, addr)
}

func dial(ctx context.Context, dialer net.Dialer, network, address string) (net.Conn, error) {
return dialer.DialContext(ctx, network, address)
}

func available() bool {
return false
}

0 comments on commit f92c31f

Please sign in to comment.