
    /*
    pub fn new_shared(
        event_callback: impl Fn(&Network, AdapterEvent) + Send + 'static,
    ) -> Arc<Network> {
        let mut launcher = AdapterLauncher::default();
        Transport::iter().for_each(|transport| transport.mount_adapter(&mut launcher));

        let network = Arc::new(Network { engine: NetworkEngine::new(launcher)});

        let internal_network = network.clone();
        network.engine.run(move |adapter_event| {
            event_callback(internal_network.as_ref(), adapter_event);
        });

        network
    }
    */

To read a message, you use:
```rust
let (mut network, mut events) = Network::split();
network.listen(Transport::FramedTcp, "0.0.0.0:0").unwrap();
loop {
    match events.receive() {
        NetEvent::Message(endpoint, data) => { /* read the message here */ },
        _ => (),
    }
}

```
Although the current API is quite simple, it has a drawback: To pass messages into the `EventQueue` you need to perform a copy of that message. This is why the signature of the `NetEvent::Message<Endpoint, Vec<u8>>` has an allocated vector instead of reference like `&[u8]`. This copy is necessary because once you send data into the queue, the lifetime of the referenced data is lost. The internal socket buffer can be overwritten with a new incoming message before you read the previous one.

To avoid this issue you can avoid sending the data into `EventQueue` in order to process the message directly from the `AdapterEvent` which signature reference the internal input buffer: `AdapterEvent::Data(Endpoint, &[u8])`:
```rust
let network = Network::new(|adapter_event| {
    match adapter_event {
        NetEvent::Message(endpoint, data) => { /* read the message here */ },
        _ => (),
    }
});
```

Although this works, it reduces the API usage:
- How I can send a message just after read it?. I can not access to the `Network` instance in its own callback.
-
