Fibers and std.socket

ikod geller.garry at gmail.com
Fri May 22 10:56:35 UTC 2020


On Friday, 22 May 2020 at 06:10:38 UTC, Atwork wrote:
> Is it possible to mix fibers with sockets from phobos?
>
> If so, how would I do it?
>
> Like just a simple example of async sockets using fibers in D.
>
> I will say that I'd prefer to not use any packages ex. vibe.d

Yes you can mix std sockets with fibers, but then you have two 
options - either sockets are in blocking mode (and every socket 
can block current thread and other fibers) or you use sockets in 
non-blocking mode and then you have to manage socket events in 
some hand-made event loop. AFAIK there is no other options.


More information about the Digitalmars-d-learn mailing list