fileServerStop (Function)
Signature: fileServerStop(port: int) -> int
Description: Stops the server on a port and returns 0, or -1 when none runs there.
Parameters
- port (
int): Port from fileServerStart
Returns: int
Example
let address = netLocalAddress("127.0.0.1", 9)
let port = fileServerStart("song.mp3", "audio/mpeg", address)
print(if port > 0 { "serving on ${port}; stopped=${fileServerStop(port)}" } else { "not served: ${port}" })
address = netLocalAddress ("127.0.0.1", 9)
port = fileServerStart ("song.mp3", "audio/mpeg", address)
print (if port > 0 { "serving on ${port}; stopped=${fileServerStop(port)}" } else ["not served => ${port}"])