Skip to content

Commit

Permalink
Merge pull request #317 from oliveroneill/server-start-bug
Browse files Browse the repository at this point in the history
Fix bug where server may fail to start
  • Loading branch information
damian-kolakowski authored Jun 7, 2018
2 parents 078cc0e + 8f9e068 commit b332956
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/HttpServerIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class HttpServerIO {
self.state = .starting
let address = forceIPv4 ? listenAddressIPv4 : listenAddressIPv6
self.socket = try Socket.tcpSocketForListen(port, forceIPv4, SOMAXCONN, address)
self.state = .running
DispatchQueue.global(qos: priority).async { [weak self] in
guard let strongSelf = self else { return }
guard strongSelf.operating else { return }
Expand All @@ -93,7 +94,6 @@ public class HttpServerIO {
}
strongSelf.stop()
}
self.state = .running
}

public func stop() {
Expand Down

0 comments on commit b332956

Please sign in to comment.