Add basic tcp socket test
This commit is contained in:
@@ -124,7 +124,11 @@ impl lb_netlib {
|
||||
}
|
||||
|
||||
extern "Lua-C" fn __parse_skaddr(&self, addr: &str) -> Result<lb_socketaddr> {
|
||||
Ok(addr.parse()?)
|
||||
Ok(if let Ok(addr) = addr.parse() {
|
||||
SocketAddr::new(addr, 0).into() // default port 0
|
||||
} else {
|
||||
addr.parse::<SocketAddr>()?.into()
|
||||
})
|
||||
}
|
||||
|
||||
/// Creates a new TCP socket configured for IPv4.
|
||||
|
||||
Reference in New Issue
Block a user