Re: Learning asynchronous sockets in D (well actually C...)

2012-06-24 Thread Jarl André
On Sunday, 24 June 2012 at 23:04:14 UTC, Sean Kelly wrote: On Jun 24, 2012, at 11:40 AM, "Jarl André" "@puremagic.com wrote: Is it wrong to badge myself with asynchronous sockets? :) Nope. It's pretty weird stuff if you've never done event-based programming befo

Re: Learning asynchronous sockets in D (well actually C...)

2012-06-24 Thread Jarl André
On Sunday, 24 June 2012 at 19:10:55 UTC, Tobias Pankrath wrote: * add -g and -debug=splat (or any other keywords) to the build command You don't need a keyword -debug is sufficient. To make the binary work with a debugger you does not even need -debug, only -g. -debug only includes code that

Re: Learning asynchronous sockets in D (well actually C...)

2012-06-24 Thread Jarl André
I have now completely and totally replaced the inner contents of my server library with modified Splat code. It ran so much faster that I was actually afraid I had got it wrong. It seemed not be any wrong with it, so adding Splat actually made it super kidding me fast. I have now learned a few

Learning asynchronous sockets in D (well actually C...)

2012-06-23 Thread Jarl André
The learning curve has been from like zero to "something". I am still grasping for some fundamental knowledge that I need to fully "get" whats going on. Had to read documentation for sockets in C to understand anything at all. That says a lot. Coming from BufferedReader hell in Java and did nev

Re: Does D have high-performance sockets

2012-06-13 Thread Jarl André
On Wednesday, 13 June 2012 at 10:24:58 UTC, Dmitry Olshansky wrote: On 13.06.2012 1:29, D Day wrote: Are there any implementations of this anywhere for D? I really only care about the windows platform - and have considered writing this myself with IOCP and std.socket, but I figure someone els

Segmentation fault hell in D

2012-06-08 Thread Jarl André
Evry single time I encounter them I yawn. It means using the next frickin hour to comment away code, add more log statements and try to eleminate whats creating the hell of bugz, segmantation fault. Why can't the compiler tell me anything else than the fact that i have referenced data that does

Re: Simplified socket creation and handling

2012-06-05 Thread Jarl André
Thank you for the Windows compatibility. I will try it out ASAP. I have now added some subtle changes to the server and example echo server. I have added an example for how byte streams can be passed to the server by converting them to base64. In my example the base64 encoded data is appended

Re: Simplified socket creation and handling

2012-06-02 Thread Jarl André
Now the similarity to the original quickserver library in java is so ripped off that I had an email sent over to the author asking for permission to continue on the api clone or alternatively change the api. Comments or suggestions? sucks totally or worth a penny?

Re: Socket identification key

2012-05-31 Thread Jarl André
I don't know why but for some reason this did not come to my mind. LOL Its a bit embarassing really because I work with Java every day and memory reference is a core feature. But I think the SocketSet buzzed my brain making me think that it gave me different objects or something. But anyway

Re: Socket identification key

2012-05-31 Thread Jarl André
On Thursday, 31 May 2012 at 14:46:42 UTC, Alex Rønne Petersen wrote: On 31-05-2012 16:44, "Jarl André" " wrote: Hi I have searched high and low to figure this one out. There does not seems to be a an accessible way of getting a unique key for a socket. I have learned that por

Socket identification key

2012-05-31 Thread Jarl André
Hi I have searched high and low to figure this one out. There does not seems to be a an accessible way of getting a unique key for a socket. I have learned that port numbers count a great deal but really shouldn't there be some internal numbering or representation of each socket that the deve

Re: Simplified socket creation and handling

2012-05-30 Thread Jarl André
On Wednesday, 30 May 2012 at 20:09:43 UTC, Jarl André wrote: On Monday, 21 May 2012 at 19:06:24 UTC, Nathan M. Swan wrote: On Monday, 21 May 2012 at 17:54:56 UTC, Adam D. Ruppe wrote: On Saturday, 19 May 2012 at 20:33:49 UTC, Nathan M. Swan wrote: It has some pitfalls (e.g. I can't find a

Re: Simplified socket creation and handling

2012-05-30 Thread Jarl André
On Monday, 21 May 2012 at 19:06:24 UTC, Nathan M. Swan wrote: On Monday, 21 May 2012 at 17:54:56 UTC, Adam D. Ruppe wrote: On Saturday, 19 May 2012 at 20:33:49 UTC, Nathan M. Swan wrote: It has some pitfalls (e.g. I can't find a good way to stop the server) When I use it, I just leave it open

Re: Simplified socket creation and handling

2012-05-30 Thread Jarl André
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

Re: Simplified socket creation and handling

2012-05-30 Thread Jarl André
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

Re: Converting from string to enum by name

2012-05-29 Thread Jarl André
On Monday, 28 May 2012 at 18:53:50 UTC, Ali Çehreli wrote: On 05/28/2012 11:50 AM, "Jarl André" " wrote: > 1. Is there a way to convert from string "INFO" to LogLevel.INFO, by name? conv.to can do that: import std.conv; enum LogLevel { ALL, INFO, WARNING } v

Converting from string to enum by name

2012-05-28 Thread Jarl André
Hi I have a project on github, https://github.com/jarlah/d2-simple-socket-server, where I have added very custom logger library. In this logger library I have an enum LogLevel that looks like enum LogLevel { ALL, INFO, WARNING etc } Questions: 1. Is there a way to convert from string "INFO

Re: Simplified socket creation and handling

2012-05-27 Thread Jarl André
Sorry for the typo: I do NOT understand it completely. Thanks for the feedback! Well, for me I am a Java enterprise developer working with Java on Unix, but, I have worked with .NET in the past giving me a tiny portion of mercy to those that enjoys Visual Studio :) Its actually a blazing fast

Re: Simplified socket creation and handling

2012-05-27 Thread Jarl André
On Friday, 25 May 2012 at 20:55:12 UTC, Donald Duvall wrote: On Friday, 25 May 2012 at 20:50:25 UTC, Donald Duvall wrote: On Wednesday, 23 May 2012 at 19:24:53 UTC, Jarl André wrote: On Wednesday, 23 May 2012 at 13:39:09 UTC, Jarl André wrote: On Saturday, 19 May 2012 at 20:33:49 UTC, Nathan M

Re: Simplified socket creation and handling

2012-05-23 Thread Jarl André
On Wednesday, 23 May 2012 at 13:39:09 UTC, Jarl André wrote: On Saturday, 19 May 2012 at 20:33:49 UTC, Nathan M. Swan 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

Re: Simplified socket creation and handling

2012-05-23 Thread Jarl André
On Saturday, 19 May 2012 at 20:33:49 UTC, Nathan M. Swan 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

Simplified socket creation and handling

2012-05-17 Thread Jarl André
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

Re: parse json-string - operator overload error

2012-05-17 Thread Jarl André
On Wednesday, 1 December 2010 at 08:17:37 UTC, zusta wrote: Hey guys, I'm trying to read a JSON-formated file. The parsing of the file seems to be correct, but I always get the following error: "Error: no [] operator overload for type JSONValue". For testing purposes, I also tried the code o

Re: std.json

2012-05-17 Thread Jarl André
On Thursday, 17 May 2012 at 18:36:22 UTC, Jarl André wrote: On Thursday, 17 May 2012 at 14:08:27 UTC, Vincent wrote: On Sunday, 25 March 2012 at 17:50:45 UTC, Andrea Fontana wrote: Hope it's clear... Nope, it's something like chess and have nothing common with simplicity of the

Re: std.json

2012-05-17 Thread Jarl André
On Thursday, 17 May 2012 at 14:08:27 UTC, Vincent wrote: On Sunday, 25 March 2012 at 17:50:45 UTC, Andrea Fontana wrote: Hope it's clear... Nope, it's something like chess and have nothing common with simplicity of the real JSON usage! This is example from C#: var p = JsonConvert.Deserializ