Re: Socket - handling large numbers of incoming connections

2015-12-22 Thread Jakob Jenkov via Digitalmars-d-learn
Thanks, everyone, I have looked a bit at different frameworks, and it seems that libasync might have a decently narrow scope to fit what I need. I have a background in Java, so a lot of this OS-specific stuff is new to me (EPoll etc.). In Java that stuff is used under the hood for you, withou

Re: Socket - handling large numbers of incoming connections

2015-12-22 Thread Jakob Jenkov via Digitalmars-d-learn
The same as in C [1]. Just change #include to import core.sys.posix.poll; [1] http://linux.die.net/man/2/poll I have a background in Java, so I am a bit handicapped :-)

Re: Socket - handling large numbers of incoming connections

2015-12-22 Thread Johannes Pfau via Digitalmars-d-learn
Am Mon, 21 Dec 2015 23:29:14 + schrieb Adam D. Ruppe : > On Monday, 21 December 2015 at 23:17:45 UTC, Daniel Kozák wrote: > > If you want to reinvent the wheel you can use > > [...] it isn't like the bundled functions with the OS are > hard to use [...] > epoll and similar interfaces are

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Daniel Kozak via Digitalmars-d-learn
V Mon, 21 Dec 2015 23:29:14 + "Adam D. Ruppe via Digitalmars-d-learn" napsáno: > On Monday, 21 December 2015 at 23:17:45 UTC, Daniel Kozák wrote: > > If you want to reinvent the wheel you can use > > It isn't really reinventing the wheel to just use an alternate > library... I guess you a

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 21 December 2015 at 23:17:45 UTC, Daniel Kozák wrote: If you want to reinvent the wheel you can use It isn't really reinventing the wheel to just use an alternate library... it isn't like the bundled functions with the OS are hard to use and you really should understand how they wo

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Daniel Kozák via Digitalmars-d-learn
V Mon, 21 Dec 2015 20:53:14 + Jakob Jenkov via Digitalmars-d-learn napsáno: > On Monday, 21 December 2015 at 20:20:44 UTC, Stefan wrote: > > How about https://github.com/dcarp/asynchronous ? Asyncio > > Socket handling is sometimes quite nice. It's performance is > > okay for nearly no effo

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Adrian Matoga via Digitalmars-d-learn
On Monday, 21 December 2015 at 21:32:55 UTC, Jakob Jenkov wrote: My server uses "poll" for that. Okay, how does that work? How do I use "poll" in D? Link? Code example? The same as in C [1]. Just change #include to import core.sys.posix.poll; [1] http://linux.die.net/man/2/poll

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Jakob Jenkov via Digitalmars-d-learn
My server uses "poll" for that. Okay, how does that work? How do I use "poll" in D? Link? Code example?

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread tcak via Digitalmars-d-learn
On Monday, 21 December 2015 at 20:53:14 UTC, Jakob Jenkov wrote: On Monday, 21 December 2015 at 20:20:44 UTC, Stefan wrote: How about https://github.com/dcarp/asynchronous ? Asyncio Socket handling is sometimes quite nice. It's performance is okay for nearly no effort and the code looks clean.

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Jakob Jenkov via Digitalmars-d-learn
On Monday, 21 December 2015 at 20:20:44 UTC, Stefan wrote: How about https://github.com/dcarp/asynchronous ? Asyncio Socket handling is sometimes quite nice. It's performance is okay for nearly no effort and the code looks clean. Details here: http://dcarp.github.io/asynchronous/asynchronous/st

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread Stefan via Digitalmars-d-learn
How about https://github.com/dcarp/asynchronous ? Asyncio Socket handling is sometimes quite nice. It's performance is okay for nearly no effort and the code looks clean. Details here: http://dcarp.github.io/asynchronous/asynchronous/streams/startServer.html vibe.d also offers a fiber based as

Socket - handling large numbers of incoming connections

2015-12-21 Thread Jakob Jenkov via Digitalmars-d-learn
What is the fastest / most scalable way to implement a server (using a Socket) which can handle large numbers of incoming connections? Like, at least 10K, but probably up to 1 million connections. More specifically: 1) How do I efficiently select the connections (client Socket instances) whi