Commit Graph

3 Commits

Author SHA1 Message Date
Liam Flynn df4e078c74 Add 2 missing server readme docs. (#940)
Add missing server readme docs for WebSocket server and UDP echo server.

Motivation:
With the exception of these two samples, all client and server examples have helpful readme docs.
Provides brief description of purpose of the sample code and how to run it.

Modifications:
Adds a readme to NIOUDPEchoServer.
Adds a readme to NIOWebSocketServer.

Result:
The samples for NIOUDPEchoServer and NIOWebSocketServer have a little explanation.
2019-04-02 11:28:31 +01:00
Johannes Weiss f1efb4a104
new http parser (#814)
Motivation:

The old HTTP parser tried to convert `http_parser` to a one-shot parser
by pausing it constantly. That was done to be resilient against
re-entrancy. But now, we have the new `ByteToMessageDecoder` which
protects against that so HTTP decoder can just become a real
`ByteToMessageDecoder`. It also serves as a great testbed for
`ByteToMessageDecoder`.

Modifications:

- make the HTTP decoder a `ByteToMessageDecoder`
- refactor the implementation

Result:

cleaner code, more use of `ByteToMessageDecoder`
2019-03-06 11:51:42 +00:00
Cory Benfield b13bc66062 Support using recvmmsg to perform gathering reads. (#743)
Motivation:

Some DatagramChannels are extremely high-throughput. This can occur
when UDP is being used as an encapsulation for a transport protocol
(e.g. QUIC), or when a highly utilized service is being offered on a
single port (e.g. DNS).

In these cases, the syscall overhead of datagram reads is quite high
(one recvfrom call per datagram). It would be helpful to be able to
trade off some memory usage in order to reduce the cost of the syscalls
in this situation.

This patch adds support for transparently using the recvmmsg syscall
to achieve this kind of tradeoff.

Modifications:

- Added support to the DatagramChannel for issuing vector reads.
- Added new ChannelOption: DatagramVectorReadMessageCountOption
- Added UDP echo server example to exercise functionality.
- Tests

Result:

Able to achieve higher read throughput on supported systems.
2019-03-05 11:25:21 +00:00