File tree 4 files changed +5
-15
lines changed 4 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -309,13 +309,5 @@ func (fd *netFD) dup() (f *os.File, err error) {
309
309
return nil , err
310
310
}
311
311
312
- // We want blocking mode for the new fd, hence the double negative.
313
- // This also puts the old fd into blocking mode, meaning that
314
- // I/O will block the thread instead of letting us use the epoll server.
315
- // Everything will still work, just with more threads.
316
- if err = fd .pfd .SetBlocking (); err != nil {
317
- return nil , os .NewSyscallError ("setnonblock" , err )
318
- }
319
-
320
312
return os .NewFile (uintptr (ns ), fd .name ()), nil
321
313
}
Original file line number Diff line number Diff line change @@ -281,15 +281,13 @@ func (c *conn) SetWriteBuffer(bytes int) error {
281
281
return nil
282
282
}
283
283
284
- // File sets the underlying os.File to blocking mode and returns a copy.
284
+ // File returns a copy of the underlying os.File
285
285
// It is the caller's responsibility to close f when finished.
286
286
// Closing c does not affect f, and closing f does not affect c.
287
287
//
288
288
// The returned os.File's file descriptor is different from the connection's.
289
289
// Attempting to change properties of the original using this duplicate
290
290
// may or may not have the desired effect.
291
- //
292
- // On Unix systems this will cause the SetDeadline methods to stop working.
293
291
func (c * conn ) File () (f * os.File , err error ) {
294
292
f , err = c .fd .dup ()
295
293
if err != nil {
Original file line number Diff line number Diff line change @@ -292,8 +292,8 @@ func (l *TCPListener) SetDeadline(t time.Time) error {
292
292
return nil
293
293
}
294
294
295
- // File returns a copy of the underlying os.File, set to blocking
296
- // mode. It is the caller's responsibility to close f when finished.
295
+ // File returns a copy of the underlying os.File.
296
+ // It is the caller's responsibility to close f when finished.
297
297
// Closing l does not affect f, and closing f does not affect l.
298
298
//
299
299
// The returned os.File's file descriptor is different from the
Original file line number Diff line number Diff line change @@ -286,8 +286,8 @@ func (l *UnixListener) SetDeadline(t time.Time) error {
286
286
return nil
287
287
}
288
288
289
- // File returns a copy of the underlying os.File, set to blocking
290
- // mode. It is the caller's responsibility to close f when finished.
289
+ // File returns a copy of the underlying os.File.
290
+ // It is the caller's responsibility to close f when finished.
291
291
// Closing l does not affect f, and closing f does not affect l.
292
292
//
293
293
// The returned os.File's file descriptor is different from the
You can’t perform that action at this time.
0 commit comments