r8k / echoev

echo client and server written using libev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WHAT

echoev is a simple TCP echo server, built on libev. It has several options; run ‘echoev –help’ for usage.

echoevc is a simple TCP echo client, also built on libev. It, too, has several options; run ‘echoevc –help’ for usage.

WHY

I wrote echoev and echoevc to get some experience with libev.

INSTALLING

  1. In the Makefile, uncomment the PLATFORM define for your platform.
  2. Set the INCLUDES and LIBS Makefile variables to point to your libev install, if it’s in a non-standard location.
  3. make

LICENSE

Most of the code is licensed under the MIT license.

The code in ringbuf.[ch] and logging.[ch] is dedicated to the public domain under the terms of the Creative Commons CC0 public domain dedication. See

http://creativecommons.org/publicdomain/zero/1.0/legalcode

for details.

BUGS/LIMITATIONS

  • The server uses a per-connection ring buffer to prevent clients from DOSing the host (e.g., by writing an endless stream of bytes to the server without ever reading any of them back). The ring buffer capacity is 8192 bytes, so the client cannot have more than 8192 bytes outstanding to be read from the server, nor can it write a single line greater than 8192 bytes. If the client exceeds its buffer size, the server will unceremoniously close the connection.
  • The client also uses a ring buffer (for convenience, not for any kind of security). Its buffer capacity is 32KiB. The client will do what it can to prevent the buffer from overflowing, but the buffer size does limit the maximum line size that can be sent to the server.

CONTACT

Drew Hess <dhess-src@bothan.net>

http://drewhess.com/

About

echo client and server written using libev

License:Other