0

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.

Ghita
  • 4,465
  • 4
  • 42
  • 69

3 Answers3

1

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

jmbeck
  • 938
  • 2
  • 11
  • 21
  • Do they use something specific for windows ? Overlapped or completion ports ? – Ghita Jan 23 '12 at 14:09
  • They do specific Windows things, yes. Boost abstracts away the details for any given OS, but here is an answer that may help: [Socket I/O mode epoll,overlapped I/O](http://stackoverflow.com/questions/5431639/socket-i-o-mode-epoll-overlapped-i-o) – jmbeck Jan 23 '12 at 18:14
0

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

diblibre
  • 36
  • 2
0

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.

Ambroz Bizjak
  • 7,809
  • 1
  • 38
  • 49
  • Sounds good. I will have a look. But I would mainly consider a C++ implementation for my project. – Ghita Jan 23 '12 at 15:35
  • From my own experience C is more suitable for network servers. It also seems to be more widely used for this purpose as far as open source software goes; consider Apache, lighttpd, nginx, Unbound, Postfix, OpenVPN, Varnish, .. – Ambroz Bizjak Jan 23 '12 at 16:06
  • Does Bad have an asychronous socket service called BadAss? because that would be cool. :) – selbie Jan 24 '12 at 07:35
  • @Ambroz I agree with you that C seems to be more widely used, at least for open source software. On the other hand C++ should be equally good these days. I was thinking as suggested by jmbeck at boost.asio I wonder if this is flexible enough for my proposes and if it doesn't introduce unnecessarily complexity though.. – Ghita Jan 24 '12 at 09:53