@@ -30,7 +30,8 @@ type StartedData =
3030 ( x.GetStartedListeningElapsedMilliseconds()) .ToString() + " ms with binding " + x.binding.ip.ToString() + " :" + x.binding.port.ToString()
3131
3232/// Stop the TCP listener server
33- let stopTcp reason ( socket : Socket ) =
33+ let stopTcp ( reason : string ) ( socket : Socket ) =
34+ Console.WriteLine( " Stopping TCP server due to {0}" , reason)
3435 try
3536 socket.Dispose()
3637 with ex ->
@@ -198,7 +199,7 @@ let runServer maxConcurrentOps bufferSize (binding: SocketBinding) (runtime:Http
198199 let ipAddress = startData.binding.ip.ToString()
199200 let port = startData.binding.port
200201
201- Console.WriteLine( $" Smooth! Suave listener started in {startedListeningMilliseconds} ms with binding {ipAddress}:{port}" )
202+ Console.WriteLine( $" Smooth! Suave v{Globals.SuaveVersion} listener started in {startedListeningMilliseconds} ms with binding {ipAddress}:{port}" )
202203
203204 let remoteBinding ( socket : Socket ) =
204205 let rep = socket.RemoteEndPoint :?> IPEndPoint
@@ -250,10 +251,8 @@ let runServer maxConcurrentOps bufferSize (binding: SocketBinding) (runtime:Http
250251 // SSL handshake failed, return connection to pool
251252 connectionPool.Push( connection)
252253 with ex ->
253- // Re-raise if not a cancellation exception
254- match ex with
255- | :? OperationCanceledException -> ()
256- | _ -> raise ex
254+ if Globals.verbose then
255+ Console.WriteLine( " TCP server accept exception: {0}" , ex)
257256
258257 stopTcp " cancellation requested" listenSocket
259258 with
@@ -262,6 +261,7 @@ let runServer maxConcurrentOps bufferSize (binding: SocketBinding) (runtime:Http
262261 | :? TaskCanceledException ->
263262 stopTcp " The operation was canceled" listenSocket
264263 | ex ->
264+ Console.WriteLine( " TCP server runtime exception: {0}" , ex)
265265 stopTcp " runtime exception" listenSocket
266266 }))
267267
0 commit comments