Using Vibe.d for not HTTP

Russel Winder russel at winder.org.uk
Sun May 24 16:01:11 UTC 2020


On Sun, 2020-05-24 at 12:26 +0000, bauss via Digitalmars-d-learn wrote:
[…]

Thanks for responding, much appreciated.

> void handleConnections(TCPConnection connection) {
>     ...
> }

I guess I was looking for an example of what to put in this function!

> auto buf = new ubyte[amount];
> 
> connection.read(temp);

The documentation on read is sadly lacking :-(
https://vibed.org/api/vibe.core.net/TCPConnection.read

It seems to block pending filling all the spaces in the buffer. Not really
very useful.

I tried:

connection.read(buffer, IOMode.once);

but there seems no report on how many bytes were read, you have to guess by
parsing the buffer and making assumptions. Unless I am missing something,
which I really hope I am.


> connection.write(buf);

Not quite at that stage yet!

[…]

-- 
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/20200524/11ee8c77/attachment.sig>


More information about the Digitalmars-d-learn mailing list