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

Side by Side Diff: src/pkg/net/sock_posix.go

Issue 8608044: code review 8608044: net: separate pollster initialization from network file descriptor allocation (Closed)
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:
View unified diff | Download patch
« no previous file with comments | « src/pkg/net/file_unix.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.init(); err != nil {
97 fd.Close()
98 return nil, err
99 }
96 100
97 var rsa syscall.Sockaddr 101 var rsa syscall.Sockaddr
98 if raddr != nil { 102 if raddr != nil {
99 rsa, err = raddr.sockaddr(f) 103 rsa, err = raddr.sockaddr(f)
100 if err != nil { 104 if err != nil {
101 return nil, err 105 return nil, err
102 } 106 }
103 } 107 }
104 108
105 if rsa != nil { 109 if rsa != nil {
(...skipping 11 matching lines...) Expand all
117 } 121 }
118 122
119 lsa, _ = syscall.Getsockname(s) 123 lsa, _ = syscall.Getsockname(s)
120 if rsa, _ = syscall.Getpeername(s); rsa != nil { 124 if rsa, _ = syscall.Getpeername(s); rsa != nil {
121 fd.setAddr(toAddr(lsa), toAddr(rsa)) 125 fd.setAddr(toAddr(lsa), toAddr(rsa))
122 } else { 126 } else {
123 fd.setAddr(toAddr(lsa), raddr) 127 fd.setAddr(toAddr(lsa), raddr)
124 } 128 }
125 return fd, nil 129 return fd, nil
126 } 130 }
OLDNEW
« no previous file with comments | « src/pkg/net/file_unix.go ('k') | no next file » | no next file with comments »

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