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

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

Issue 8608044: code review 8608044: net: separate pollster initialization from network file descriptor allocation (Closed)
Left Patch Set: diff -r d99e8966136e https://code.google.com/p/go Created 10 years, 7 months ago
Right Patch Set: diff -r edb46df3ae05 https://code.google.com/p/go Created 10 years, 7 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/file_unix.go ('k') | no next file » | 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 // +build darwin freebsd linux netbsd openbsd windows 5 // +build darwin freebsd linux netbsd openbsd windows
6 6
7 package net 7 package net
8 8
9 import ( 9 import (
10 "syscall" 10 "syscall"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if err = syscall.Bind(s, lsa); err != nil { 86 if err = syscall.Bind(s, lsa); err != nil {
87 closesocket(s) 87 closesocket(s)
88 return nil, err 88 return nil, err
89 } 89 }
90 } 90 }
91 91
92 if fd, err = newFD(s, f, t, net); err != nil { 92 if fd, err = newFD(s, f, t, net); err != nil {
93 closesocket(s) 93 closesocket(s)
94 return nil, err 94 return nil, err
95 } 95 }
96 » if err := fd.Open(); err != nil { 96 » if err := fd.init(); err != nil {
97 fd.Close() 97 fd.Close()
98 return nil, err 98 return nil, err
99 } 99 }
100 100
101 var rsa syscall.Sockaddr 101 var rsa syscall.Sockaddr
102 if raddr != nil { 102 if raddr != nil {
103 rsa, err = raddr.sockaddr(f) 103 rsa, err = raddr.sockaddr(f)
104 if err != nil { 104 if err != nil {
105 return nil, err 105 return nil, err
106 } 106 }
(...skipping 14 matching lines...) Expand all
121 } 121 }
122 122
123 lsa, _ = syscall.Getsockname(s) 123 lsa, _ = syscall.Getsockname(s)
124 if rsa, _ = syscall.Getpeername(s); rsa != nil { 124 if rsa, _ = syscall.Getpeername(s); rsa != nil {
125 fd.setAddr(toAddr(lsa), toAddr(rsa)) 125 fd.setAddr(toAddr(lsa), toAddr(rsa))
126 } else { 126 } else {
127 fd.setAddr(toAddr(lsa), raddr) 127 fd.setAddr(toAddr(lsa), raddr)
128 } 128 }
129 return fd, nil 129 return fd, nil
130 } 130 }
LEFTRIGHT

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