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

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

Issue 5294074: code review 5294074: src/pkg/[n-z]*: gofix -r error (Closed)
Left Patch Set: diff -r 2d06d4a5cb7f FAKE_REPOSITORY Created 13 years, 4 months ago
Right Patch Set: diff -r b78bb4f2d2a3 https://go.googlecode.com/hg/ Created 13 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/tcpsock.go ('k') | src/pkg/net/tcpsock_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
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 // TCP for Plan 9 5 // TCP for Plan 9
6 6
7 package net 7 package net
8 8
9 import (
10 "os"
11 )
12
9 // TCPConn is an implementation of the Conn interface 13 // TCPConn is an implementation of the Conn interface
10 // for TCP network connections. 14 // for TCP network connections.
11 type TCPConn struct { 15 type TCPConn struct {
12 plan9Conn 16 plan9Conn
17 }
18
19 // CloseRead shuts down the reading side of the TCP connection.
20 // Most callers should just use Close.
21 func (c *TCPConn) CloseRead() error {
22 if !c.ok() {
23 return os.EINVAL
24 }
25 return os.EPLAN9
26 }
27
28 // CloseWrite shuts down the writing side of the TCP connection.
29 // Most callers should just use Close.
30 func (c *TCPConn) CloseWrite() error {
31 if !c.ok() {
32 return os.EINVAL
33 }
34 return os.EPLAN9
13 } 35 }
14 36
15 // DialTCP connects to the remote address raddr on the network net, 37 // DialTCP connects to the remote address raddr on the network net,
16 // which must be "tcp", "tcp4", or "tcp6". If laddr is not nil, it is used 38 // which must be "tcp", "tcp4", or "tcp6". If laddr is not nil, it is used
17 // as the local address for the connection. 39 // as the local address for the connection.
18 func DialTCP(net string, laddr, raddr *TCPAddr) (c *TCPConn, err error) { 40 func DialTCP(net string, laddr, raddr *TCPAddr) (c *TCPConn, err error) {
19 switch net { 41 switch net {
20 case "tcp", "tcp4", "tcp6": 42 case "tcp", "tcp4", "tcp6":
21 default: 43 default:
22 return nil, UnknownNetworkError(net) 44 return nil, UnknownNetworkError(net)
(...skipping 27 matching lines...) Expand all
50 } 72 }
51 if laddr == nil { 73 if laddr == nil {
52 return nil, &OpError{"listen", "tcp", nil, errMissingAddress} 74 return nil, &OpError{"listen", "tcp", nil, errMissingAddress}
53 } 75 }
54 l1, err := listenPlan9(net, laddr) 76 l1, err := listenPlan9(net, laddr)
55 if err != nil { 77 if err != nil {
56 return 78 return
57 } 79 }
58 return &TCPListener{*l1}, nil 80 return &TCPListener{*l1}, nil
59 } 81 }
LEFTRIGHT

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