Simplified socket creation and handling

Jarl André" <jarl.andre at gmail.com> Jarl André" <jarl.andre at gmail.com>
Wed May 30 12:09:58 PDT 2012


On Wednesday, 30 May 2012 at 08:40:48 UTC, Dejan Lekic wrote:
> On Friday, 18 May 2012 at 06:35:59 UTC, Jarl André wrote:
>> I am a Java developer who is tired of java.nio and similar 
>> complex socket libraries.
>>
>> In Java you got QuickServer, the ultimate protocol creation 
>> centered socket library. You don't have to write any channels 
>> and readers and what not. You just instantiate a server, 
>> configures the handlers (fill in classes that extends a 
>> handler interface) and there you go.
>>
>> Shouldn't there exist a similar library in any programming 
>> language? Not doing so is assuming that developers always need 
>> control of the lower layers. Its not true. I care about 
>> protocol. Not sockets.
>>
>> Is there any abstraction layers in phobos? Or is everything 
>> just as complex as before?
>
> I use QuickServer myself, and was thinking about creating 
> something like that in D for quite some time...

Good to hear! Your comment sparked the last in me to find out 
what was terribly wrong with my code. Spawning 1000 threads to 
the service never succeded. By investigating and copying from the 
listener example in std.socket library I found out that I had to 
use the SocketSet for all socket connections. In Java I could 
communicate based on a socket connection per client in multiple 
threads. With the berkeley api i am not able to do the same thing 
and it all fails tremendously if i try. Any reason why I cannot 
take a socket and communicate with its receive and send method 
solely?


More information about the Digitalmars-d-learn mailing list