digitalmars.D.learn - Non-blocking UDP calls using std.socket
- Andre Artus (15/15) Dec 17 2014 I've written a small program that uses UdpSocket (std.socket) to
- Rikki Cattermole (3/16) Dec 17 2014 Have you looked at vibe.d?
- Andre Artus (11/13) Dec 17 2014 Thanks Rikki,
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (4/12) Dec 17 2014 It uses fibers to make it look as if it were a synchronous,
- Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d-learn (7/29) Dec 17 2014 V Wed, 17 Dec 2014 08:20:42 +0000
- Andre Artus (3/7) Dec 17 2014 Thanks Daniel,
I've written a small program that uses UdpSocket (std.socket) to query a DNS server for selected records. It works as expected, but I would like to try a non-blocking approach. The last time I wrote socket code (without a supporting library) was over a decade ago, and even then it was not my forté. Does anyone know of a cross-platform (Mac, Win, *nix) D library that encapsulates the asynchronous calls in a simple API? If I'm missing something in std.socket (that does the [non-blocking] trick) I would appreciate it being pointed out to me. And, if it's not too much trouble, I would appreciate a code snippet or link to a sample. Thanks, Andre Artus
Dec 17 2014
On 17/12/2014 9:20 p.m., Andre Artus wrote:I've written a small program that uses UdpSocket (std.socket) to query a DNS server for selected records. It works as expected, but I would like to try a non-blocking approach. The last time I wrote socket code (without a supporting library) was over a decade ago, and even then it was not my forté. Does anyone know of a cross-platform (Mac, Win, *nix) D library that encapsulates the asynchronous calls in a simple API? If I'm missing something in std.socket (that does the [non-blocking] trick) I would appreciate it being pointed out to me. And, if it's not too much trouble, I would appreciate a code snippet or link to a sample. Thanks, Andre ArtusHave you looked at vibe.d? https://github.com/rejectedsoftware/vibe.d/blob/master/examples/udp/source/app.d
Dec 17 2014
-- snip --Have you looked at vibe.d? https://github.com/rejectedsoftware/vibe.d/blob/master/examples/udp/source/app.dThanks Rikki, I saw that before, but I was left with the impression that its doing blocking calls in a thread (which could very well be the simplest answer). I'll give it a bash. and the Task Parallel Library and the result was at least a ten fold speed increase. I would like to match, and preferably better, that performance in a D program. I realize that the task is predominantly network bound so D doesn't get much of its native advantage.
Dec 17 2014
On Wednesday, 17 December 2014 at 09:37:47 UTC, Andre Artus wrote:-- snip --It uses fibers to make it look as if it were a synchronous, blocking API, but under the hood it does asynchronous, non-blocking calls in an event loop.Have you looked at vibe.d? https://github.com/rejectedsoftware/vibe.d/blob/master/examples/udp/source/app.dThanks Rikki, I saw that before, but I was left with the impression that its doing blocking calls in a thread (which could very well be the simplest answer). I'll give it a bash.
Dec 17 2014
V Wed, 17 Dec 2014 08:20:42 +0000 Andre Artus via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> napsáno:I've written a small program that uses UdpSocket (std.socket) to query a DNS server for selected records. It works as expected, but I would like to try a non-blocking approach. The last time I wrote socket code (without a supporting library) was over a decade ago, and even then it was not my forté. Does anyone know of a cross-platform (Mac, Win, *nix) D library that encapsulates the asynchronous calls in a simple API? If I'm missing something in std.socket (that does the [non-blocking] trick) I would appreciate it being pointed out to me. And, if it's not too much trouble, I would appreciate a code snippet or link to a sample. Thanks, Andre Artushttps://github.com/etcimon/libasync http://code.dlang.org/packages/libevent http://code.dlang.org/packages/libev http://code.dlang.org/packages/libuv
Dec 17 2014
-- snip --https://github.com/etcimon/libasync http://code.dlang.org/packages/libevent http://code.dlang.org/packages/libev http://code.dlang.org/packages/libuvThanks Daniel, These links look interesting. Perhaps libasync could do the trick.
Dec 17 2014