method Server.port
The port the server listens on (useful with port: 0).
Example:
use std.http { Server, ServerConfig }
fn main() io, net {
match Server.bind(ServerConfig{ port: 0 }) {
Server s => {
print("{s.port() > 0}")
s.close()
}
NetError _ => print("cannot bind")
}
}Output
true
pub(api) fn port() -> u16Since. 1.0.0-beta
Returns
u16
Effects
none declared (pure unless the body says otherwise)
Defined in: std/http/http.oxl:4353