Skip to content
Fantix King edited this page Jul 9, 2014 · 5 revisions

OUTDATED

The design below is outdated.

Socket Design

Socket Design Diagram

As shown in the diagram, each box is a Rust Task, and user will only have access to the "interface" - the red box SocketBase, which will normally be implemented as for example REQ socket.

The arrows are Rust Channels - the zero-copy communication tool between Tasks. It is very similar to the idea of Pipe in libzmq. Because Rust cannot select over socket events but only channels, I had to split the socket-related jobs into separate Tasks, and control everything in a central InnerSocketBase task, where all incoming messages are selected and handled in one place.

Let's take socket.bind() for example.

Socket Bind Diagram

Clone this wiki locally