Albert Strasheim | e480b81 | 2011-03-25 14:42:25 -0400 | [diff] [blame] | 1 | // Copyright 2011 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package net |
| 6 | |
Peter Mundy | 91bcdb6 | 2011-03-25 16:11:19 -0400 | [diff] [blame] | 7 | import ( |
| 8 | "os" |
| 9 | "syscall" |
| 10 | ) |
| 11 | |
Mikio Hara | abccf6b | 2013-03-29 12:16:24 +0900 | [diff] [blame] | 12 | // FileConn returns a copy of the network connection corresponding to |
| 13 | // the open file f. It is the caller's responsibility to close f when |
| 14 | // finished. Closing c does not affect f, and closing f does not |
| 15 | // affect c. |
Russ Cox | eb69292 | 2011-11-01 22:05:34 -0400 | [diff] [blame] | 16 | func FileConn(f *os.File) (c Conn, err error) { |
Peter Mundy | 91bcdb6 | 2011-03-25 16:11:19 -0400 | [diff] [blame] | 17 | // TODO: Implement this |
| 18 | return nil, os.NewSyscallError("FileConn", syscall.EWINDOWS) |
Albert Strasheim | e480b81 | 2011-03-25 14:42:25 -0400 | [diff] [blame] | 19 | } |
| 20 | |
Mikio Hara | abccf6b | 2013-03-29 12:16:24 +0900 | [diff] [blame] | 21 | // FileListener returns a copy of the network listener corresponding |
| 22 | // to the open file f. It is the caller's responsibility to close l |
| 23 | // when finished. Closing l does not affect f, and closing f does not |
| 24 | // affect l. |
Russ Cox | eb69292 | 2011-11-01 22:05:34 -0400 | [diff] [blame] | 25 | func FileListener(f *os.File) (l Listener, err error) { |
Peter Mundy | 91bcdb6 | 2011-03-25 16:11:19 -0400 | [diff] [blame] | 26 | // TODO: Implement this |
| 27 | return nil, os.NewSyscallError("FileListener", syscall.EWINDOWS) |
Albert Strasheim | e480b81 | 2011-03-25 14:42:25 -0400 | [diff] [blame] | 28 | } |
| 29 | |
Mikio Hara | abccf6b | 2013-03-29 12:16:24 +0900 | [diff] [blame] | 30 | // FilePacketConn returns a copy of the packet network connection |
| 31 | // corresponding to the open file f. It is the caller's |
| 32 | // responsibility to close f when finished. Closing c does not affect |
| 33 | // f, and closing f does not affect c. |
Russ Cox | eb69292 | 2011-11-01 22:05:34 -0400 | [diff] [blame] | 34 | func FilePacketConn(f *os.File) (c PacketConn, err error) { |
Peter Mundy | 91bcdb6 | 2011-03-25 16:11:19 -0400 | [diff] [blame] | 35 | // TODO: Implement this |
| 36 | return nil, os.NewSyscallError("FilePacketConn", syscall.EWINDOWS) |
Albert Strasheim | e480b81 | 2011-03-25 14:42:25 -0400 | [diff] [blame] | 37 | } |