Question

I saw a very nice library for sockets in POCO library. This uses a "classic" approach that works on both linux and windows systems, mainly SELECT based approach.

I would like to know if there is something specific for windows that uses async IO(completion ports ?) as I want to use it on a high performance proxy/socks server.

Was it helpful?

Solution

Perhaps Boost::ASIO is what you're looking for?

OTHER TIPS

As part of my open-source BadVPN software project, I have developed an event-driven (single-threaded) cross-platform network programming framework for the C language. It uses epoll on Linux and IOCP on Windows.

Some important parts:

It makes heavy use of flow-based programming. For instance, BConnection, the abstraction of TCP, uses the StreamPassInterface and StreamRecvInterface general-purpose stream I/O interfaces. This is very useful; for instance, if you need to add SSL support to you application, little more is needed than throwing a BSSLConnection object on top of BConnection.

While most of the framework is well-documented, I don't yet provide any guides on how to use it. You can use this basic program as a starting point. While not intended for learning, the tun2socks program and especially the the accompanying smaller udpgw program might be useful.

Since you mentioned SOCKS, in my framework I've also implemeted a very simple SOCKS5 client (no authentication etc.) which is used by tun2socks.

I can propose a C library I wrote for a network game. This library was intended for high volume simultaneous short TCP connections. It uses asynchronous epoll, kqueues, IOCP or synchronous threads. The interface is very simple and is abstracted thru a callback in the way node.js works. As an echo server, it can handle 60k requests per second. See https://github.com/freedib/gasio

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top