Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(62)

Delta Between Two Patch Sets: src/pkg/net/udpsock_plan9.go

Issue 6525048: code review 6525048: net: protocol specific listen functions return a proper... (Closed)
Left Patch Set: diff -r ad0d92901061 https://go.googlecode.com/hg/ Created 11 years, 4 months ago
Right Patch Set: diff -r 0b46d6fe2f1c https://go.googlecode.com/hg/ Created 11 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/udp_test.go ('k') | src/pkg/net/udpsock_posix.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // UDP sockets for Plan 9 5 // UDP sockets for Plan 9
6 6
7 package net 7 package net
8 8
9 import ( 9 import (
10 "errors" 10 "errors"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // address laddr. The returned connection c's ReadFrom and WriteTo 177 // address laddr. The returned connection c's ReadFrom and WriteTo
178 // methods can be used to receive and send UDP packets with per-packet 178 // methods can be used to receive and send UDP packets with per-packet
179 // addressing. 179 // addressing.
180 func ListenUDP(net string, laddr *UDPAddr) (c *UDPConn, err error) { 180 func ListenUDP(net string, laddr *UDPAddr) (c *UDPConn, err error) {
181 switch net { 181 switch net {
182 case "udp", "udp4", "udp6": 182 case "udp", "udp4", "udp6":
183 default: 183 default:
184 return nil, UnknownNetworkError(net) 184 return nil, UnknownNetworkError(net)
185 } 185 }
186 if laddr == nil { 186 if laddr == nil {
187 » » return nil, &OpError{"listen", net, nil, errMissingAddress} 187 » » laddr = &UDPAddr{}
188 } 188 }
189 l, err := listenPlan9(net, laddr) 189 l, err := listenPlan9(net, laddr)
190 if err != nil { 190 if err != nil {
191 return 191 return
192 } 192 }
193 _, err = l.ctl.WriteString("headers") 193 _, err = l.ctl.WriteString("headers")
194 if err != nil { 194 if err != nil {
195 return 195 return
196 } 196 }
197 return &UDPConn{*l.plan9Conn()}, nil 197 return &UDPConn{*l.plan9Conn()}, nil
198 } 198 }
199 199
200 // ListenMulticastUDP listens for incoming multicast UDP packets 200 // ListenMulticastUDP listens for incoming multicast UDP packets
201 // addressed to the group address gaddr on ifi, which specifies the 201 // addressed to the group address gaddr on ifi, which specifies the
202 // interface to join. ListenMulticastUDP uses default multicast 202 // interface to join. ListenMulticastUDP uses default multicast
203 // interface if ifi is nil. 203 // interface if ifi is nil.
204 func ListenMulticastUDP(net string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, e rror) { 204 func ListenMulticastUDP(net string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, e rror) {
205 return nil, syscall.EPLAN9 205 return nil, syscall.EPLAN9
206 } 206 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b