Skip to content

Commit 051701f

Browse files
committed
add SetExactMatch to Conn interface
1 parent d734a31 commit 051701f

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

conn.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type Conn interface {
2727
Serve(int, Dispatcher) error
2828
Send(Packet) error
2929
SendTo(net.Addr, Packet) error
30+
SetExactMatch(bool)
3031
}
3132

3233
var invalidAddressRunes = []rune{'*', '?', ',', '[', ']', '{', '}', '#', ' '}

pingpong_example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func serverDispatch(server *UDPConn, errChan chan error) {
8282
})
8383
}
8484

85-
func clientDispatch(client *UDPConn, errChan chan error, pongChan chan struct{}, closeChan chan struct{}) {
85+
func clientDispatch(client Conn, errChan chan error, pongChan chan struct{}, closeChan chan struct{}) {
8686
errChan <- client.Serve(1, PatternMatching{
8787
"/pong": Method(func(msg Message) error {
8888
fmt.Println("Client received pong.")

udp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type UDPConn struct {
2626
}
2727

2828
// DialUDP creates a new OSC connection over UDP.
29-
func DialUDP(network string, laddr, raddr *net.UDPAddr) (*UDPConn, error) {
29+
func DialUDP(network string, laddr, raddr *net.UDPAddr) (Conn, error) {
3030
return DialUDPContext(context.Background(), network, laddr, raddr)
3131
}
3232

udp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestDialUDPContext(t *testing.T) {
8383
// For clients that are interested in closing the server with an OSC
8484
// message, a method is automatically added to the provided dispatcher
8585
// at the "/server/close" address that closes the server.
86-
func testUDPServer(t *testing.T, dispatcher PatternMatching) (*UDPConn, *UDPConn, chan error) {
86+
func testUDPServer(t *testing.T, dispatcher PatternMatching) (Conn, Conn, chan error) {
8787
laddr, err := net.ResolveUDPAddr("udp", "127.0.0.1:0")
8888
if err != nil {
8989
t.Fatal(err)

0 commit comments

Comments
 (0)