-
Notifications
You must be signed in to change notification settings - Fork 21
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
add unixsocket without real inode #145
Conversation
api/ruxos_posix_api/src/imp/net.rs
Outdated
} | ||
} | ||
|
||
pub enum Sockaddr { |
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.
This Sockaddr
is an illegal Camel case varibale name, and it should be more distinguishable with existing name SocketAddr
。
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.
SockaddrUn
is the same.
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.
I think SockaddrUn is clear enough to represent unix socket address, and i just change it into SockAddrUn
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.
I think SockaddrUn is clear enough to represent unix socket address, and i just change it into SockAddrUn
Using "SocketAddrUnix" as a variable name is better; Sock is somewhat less intuitive and can easily lead to confusion.
api/ruxos_posix_api/src/imp/net.rs
Outdated
@@ -208,6 +291,14 @@ impl From<ctypes::sockaddr_in> for SocketAddrV4 { | |||
} | |||
} | |||
|
|||
fn un_into_sockaddr(addr: SockaddrUn) -> (ctypes::sockaddr, ctypes::socklen_t) { | |||
debug!(" Sockaddr: {:?}", addr); |
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.
The debug message should more clear, let it tell about which function it from and other more information.
api/ruxos_posix_api/src/imp/net.rs
Outdated
size_of::<ctypes::sockaddr>() as _, | ||
) | ||
} | ||
|
||
fn into_sockaddr(addr: SocketAddr) -> (ctypes::sockaddr, ctypes::socklen_t) { | ||
debug!(" Sockaddr: {}", addr); |
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.
change this message too.
c295505
to
213d065
Compare
add unix socket ans AF_UNIX type for socket
but not impl SOCK_DGRAM, and use alloced index rather than inode for unixsocket because inode is not impl yet