oscourse-tsinghua / rcore_plus

Rust version of THU uCore OS. Linux compatible.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discussion of socket implementation

wangrunji0408 opened this issue · comments

  • Is it possible to treat a socket as a file directly?
    sockfs: impl INode for Socket
  • If we can, what should be added to the current VFS?
  • If not, can we design a socket trait to isolate syscall and network stack?

@jiegec Orz

commented
  • Is it possible to treat a socket as a file directly?
    • It let me think of Plan9 OS.
    • Hard, the syscalls needed to support have different semantics, but easy if we just throw then away.
  • If we can, what should be added to the current VFS?
    • /dev/tcp/addr/port? (as in bash)
    • Use ioctl for specific operations other than writing and reading?
  • If not, can we design a socket trait to isolate syscall and network stack?
    • Yes. I think we can delegate syscall to each type of socket struct.

👍Nice!