A vibe.d thing

Russel Winder russel at winder.org.uk
Tue Jul 31 11:49:13 UTC 2018


On Tue, 2018-07-31 at 13:10 +0200, Daniel Kozak via Digitalmars-d-learn wrote:
> On Fri, Jul 27, 2018 at 9:30 PM Steven Schveighoffer via
> Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:
> 
> > > 
> > > Maybe IOMode.immediate or .once?
> > > https://vibed.org/api/eventcore.driver/IOMode
> > 
> > Oh, it looks like you specified once. Hm... that seems to me like it
> > should work.
> > 
> > Looks like IOMode is ignored:
> > 
> > 
> > https://github.com/vibe-d/vibe.d/blob/a9589d955f10bd076a67d47ace0c78cfd3aa
> > 8246/core/vibe/core/drivers/libevent2_tcp.d#L285
> > 
> > So, no, there isn't a correct way to do this, it's unimplemented.
> > 
> > -Steve
> > 
> 
> It is implemented with vibe-core driver which should be default now
> https://github.com/vibe-d/vibe-core/blob/fae7d3e93d00d9636632aa0acf9ebc19ed9
> f4a34/source/vibe/core/net.d#L665

Sadly as of vibe.d 0.8.4 the behaviour of read(buffer, IOMode) is to either
fill the buffer completely or throw an exception. On the forum, Sönke has
agreed it really does seem like a bug in the implementation.

I found a workaround to the problem for my entry to CVu Code Critique 112,
which actually is nicer code to the one that highlighted the problem – except
that it relies on a property that has been marked deprecated.

Deadline for entries is tomorrow, so I am not now in a position to change the
article, it has to appear as it is now. Obviously once published, people are
most welcome to write an article for CVu reporting how naïve/crap my code is,
and providing better answers.

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20180731/06508d7a/attachment.sig>


More information about the Digitalmars-d-learn mailing list