Fixed a few minor typos and some force unwraps (#259)

fix some typos, force unwraps and inconsistencies

Motivation:
Reviewing the code I found a few typos that hindered readability, some unnecessary force unwraps and inconsistencies in the codebase.

Modifications:

- The main file in NIOWebSocketServer now accepts command line arguments
and binds to a passed in host and port like the other server examples do.
- Minor typo fixes
- removed one force unwrap

Result:

- The result of my change will bring the NIOWebSocketServer more inline
with how the NIOHTTP1 and NIOChat servers examples are setup.
- less force unwrapping
- fewer typos

[message edited by @weissi]
This commit is contained in:
Matt Eaton authored and Johannes Weiß committed 2018-04-03 11:44:14 +01:00
1 parent 2a684fc1dc
commit 66e4fdfbba
15 files changed
+69 -19

No files matched your search

+5 -1
View File
@@ -498,7 +498,11 @@ let channel = try { () -> Channel in
}
}()
print("Server started and listening on \(channel.localAddress!), htdocs path \(htdocs)")
if let localAddress = channel.localAddress {
print("Server started and listening on \(localAddress), htdocs path \(htdocs)")
} else {
print("Server started but the address could not be determined, htdocs path \(htdocs)")
}
// This will never unblock as we don't close the ServerChannel
try channel.closeFuture.wait()