From 892588a93c2fc90fd8f56b30223ff0ea9dcd6cdf Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 9 Jul 2014 22:23:02 +0100 Subject: [PATCH] Fix the function documentation --- udp.go | 8 +++----- udp_other.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/udp.go b/udp.go index 2b524e00..6ec72f6e 100644 --- a/udp.go +++ b/udp.go @@ -33,7 +33,6 @@ func setUDPSocketOptions(conn *net.UDPConn) error { return err } setUDPSocketOptions6(conn) - if v6only == 0 { setUDPSocketOptions4(conn) } @@ -43,20 +42,19 @@ func setUDPSocketOptions(conn *net.UDPConn) error { return nil } -// readFromSessionUDP ... Just like net.UDPConn.ReadFrom(), but returns a session object instead of net.UDPAddr -// (RemoteAddr() is available from the UDPSession object) +// readFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a +// net.UDPAddr. func readFromSessionUDP(conn *net.UDPConn, b []byte) (int, *sessionUDP, error) { oob := make([]byte, 40) n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob) if err != nil { return n, nil, err } - session := &sessionUDP{raddr, oob[:oobn]} return n, session, err } -// writeToSessionUDP Just like net.UDPConn.WritetTo(), but uses a session object instead of net.Addr +// writeToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *sessionUDP instead of a net.Addr. func writeToSessionUDP(conn *net.UDPConn, b []byte, session *sessionUDP) (int, error) { n, _, err := conn.WriteMsgUDP(b, session.context, session.raddr) return n, err diff --git a/udp_other.go b/udp_other.go index 168c9add..d93199db 100644 --- a/udp_other.go +++ b/udp_other.go @@ -10,7 +10,7 @@ import ( "net" ) -// These actually do nothing. See udp_linux.go for an example of how to implement this. +// These do nothing. See udp_linux.go for an example of how to implement this. func setUDPSocketOptions4(conn *net.UDPConn) error { return nil } func setUDPSocketOptions6(conn *net.UDPConn) error { return nil }