www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Networking library

reply Cecil Ward <d cecilward.com> writes:
Can anyone point me in the direction of a library that provides 
very very lightweight (minimum overhead) asynchronous i/o 
routines for - shopping list

1. sending and receiving IPv4 / IPv6 packets,
2. sending receiving ICMP and
3, handling incoming outgoing TCP connections and
4. handling SCTP connections.

Secondingly I am in the market for a library that handles the 
sending and receiving of straight ethernet packets. Also doing 
ARP / NDP too.

Rules of the beauty contest: Some abstraction of asynchronous i/o 
with asynchronous events, but the main priority is being very 
very lean and low-level, with top time-performance. If it comes 
to a beauty contest, this judge I would prefer something C-style 
as I don't speak C++, have yet to drink the mindless class 
bullshit koolaid. Since my background is VAX/VMS asynchronous io 
an asynchronous model with optional callbacks as in VMS or Win NT 
events will win the beauty parade. Operating systems? Cross-o/s 
portability- unsure. Not interested in solutions that are 
synchronous-io-only and so require your code to be split up into 
multiple threads just to get around the problems caused by 
synchronous (‘blocking’ some call it) io calls. Requiring threads 
is a rule-out / show stopper unless I could easily hide such a 
thing, but that doesn't sound feasible.

Any suggestions gratefully received.
Mar 14 2018
next sibling parent reply Cecil Ward <d cecilward.com> writes:
On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote:
 Can anyone point me in the direction of a library that provides 
 very very lightweight (minimum overhead) asynchronous i/o 
 routines for - shopping list

 [...]
Actually I realise that if I could simply write a wrapper pretty easily, with suitable help, then C libraries could be included in the list of candidates, but only if I can get the necessary help in writing a D-toC & C-to-D safe wafer-thin wrapper layer.
Mar 14 2018
parent Seb <seb wilzba.ch> writes:
On Thursday, 15 March 2018 at 00:10:28 UTC, Cecil Ward wrote:
 On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote:
 Can anyone point me in the direction of a library that 
 provides very very lightweight (minimum overhead) asynchronous 
 i/o routines for - shopping list

 [...]
Actually I realise that if I could simply write a wrapper pretty easily, with suitable help, then C libraries could be included in the list of candidates, but only if I can get the necessary help in writing a D-toC & C-to-D safe wafer-thin wrapper layer.
A pure D solution: https://github.com/ikod/dlang-requests (though I think it doesn't support everything on your list yet) Another pure D solution is Vibe.d - have a look at http://vibed.org/api/vibe.core.net/listenTCP While Phobos's high-level wrapper std.net.curl probably don't provide what you are looking for, the low-level curl might: https://dlang.org/phobos/etc_c_curl.html You would need to manually wrap the curl calls into an asynchronous handler though there are quite a few eventloop implementations on the dub registry.
Mar 14 2018
prev sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote:
 Can anyone point me in the direction of a library that provides 
 very very lightweight (minimum overhead) asynchronous i/o 
 routines for - shopping list

 1. sending and receiving IPv4 / IPv6 packets,
 2. sending receiving ICMP and
 3, handling incoming outgoing TCP connections and
 4. handling SCTP connections.
Given the low-level nature of some of your requests, I’d suggest seriously look at DPDK. I don’t know if there is a ready-made D wrapper, but it should be stright-forward to bind to it. That covers all of your direct packet manipulation at extreme speeds.
Mar 15 2018