mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Cleanup
This commit is contained in:
1 parent
3048360f19
commit
ffb10a59cf
2 files changed
+3
-1
No files matched your search
@@ -102,7 +102,7 @@ public class BaseSocket : Selectable {
|
||||
let res = Darwin.close(self.descriptor)
|
||||
#endif
|
||||
guard res >= 0 else {
|
||||
throw IOError(errno: errno, reason: "shutdown(...) failed")
|
||||
throw IOError(errno: errno, reason: "close(...) failed")
|
||||
}
|
||||
self.open = false
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ do {
|
||||
// Accept new connections until there are no more in the backlog
|
||||
while let accepted = try socket.accept() {
|
||||
try accepted.setNonBlocking()
|
||||
try accepted.setOption(level: SOL_SOCKET, name: SO_REUSEADDR, value: 1)
|
||||
|
||||
|
||||
// Allocate an 8kb buffer for reading and writing and register the socket with the selector
|
||||
let buffer = Buffer(capacity: 8 * 1024)
|
||||
|
||||
Reference in new issue
Block a user