-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Android compilation errors #124
Conversation
src/config.rs
Outdated
@@ -9,6 +10,19 @@ use webrtc::{ | |||
Error, | |||
}; | |||
|
|||
#[cfg(target_os = "android")] | |||
fn get_local_ip_address() -> Option<String> { | |||
// 对于Android平台,直接返回None或者一个固定的IP地址 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment should use English
src/config.rs
Outdated
|
||
#[cfg(not(target_os = "android"))] | ||
fn get_local_ip_address() -> Option<String> { | ||
// 在支持的平台上使用local_ip_address包获取IP地址,并将IpAddr转换为String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use English
src/config.rs
Outdated
@@ -152,11 +166,12 @@ fn default_http_listen() -> String { | |||
fn default_registry_ip_port() -> String { | |||
format!( | |||
"{}:{}", | |||
local_ip().unwrap(), | |||
get_local_ip_address().unwrap_or_else(|| "127.0.0.1".to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use method unwrap_or
src/config.rs
Outdated
env::var("PORT").unwrap_or(String::from("7777")) | ||
) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this blank line
791e88d
to
62d4a23
Compare
No description provided.