Closed loganwright closed 8 years ago
I think we should use closed: Bool
so that it conforms to C7.Stream more easily.
In Hummingbird, looks like closed is only set to true when close()
is called.
"closed by peer" errors are thrown on send and handled differently.
Searching 18 files for "closed = "
/Users/tanner/Downloads/Hummingbird-master/Sources/ServerSocket.swift:
52 guard setsockopt(socketDescriptor, SOL_SOCKET, SO_REUSEADDR, &optval, socklen_t(sizeof(Int))) != -1 else {
53 let _ = systemClose(socketDescriptor)
54: closed = true
55 #if swift(>=3.0)
56 let message = String(validatingUTF8: strerror(errno))
/Users/tanner/Downloads/Hummingbird-master/Sources/Socket.swift:
20
21 /// `true` if the socket is closed. Otherwise `false`.
22: public internal(set) var closed = false
23
24 /**
..
201 throw SocketError.closeFailed(code: Int(errno), message: message)
202 }
203: closed = true
204 }
205
3 matches across 2 files
@LoganWright Do you want to rename it?
@czechboy0 renamed, the conflict I was originally avoiding is no longer an issue since it's not in protocol
This looks good to me
Cool, thanks guys!
Fixes #35, @tannernelson are there any more cases when the isClosed property should be changed? Thanks @LoganWright!