Re: Pass Socket to new thread

2018-08-28 Thread Ivo via Digitalmars-d-learn
Thanks for all your answers. I'll have a look at the design and use casting if necessary.

Pass Socket to new thread

2018-08-28 Thread Ivo via Digitalmars-d-learn
I'm writing a basic server program and I want to handle each connection received in a new thread. So here is the code I'm trying to produce: while(true) { auto client = socket.accept(); spawn( , client); } void handleConnection(Socket client) { //do stuff like receive and send }

Re: Clock.currTime differs from SysTime

2018-08-25 Thread Ivo via Digitalmars-d-learn
Thanks a lot. The issue was indeed the time zone.

Clock.currTime differs from SysTime

2018-08-25 Thread Ivo via Digitalmars-d-learn
I am using Clock.currTime.stdTime to get a unique timestamp in my program. Now I need to produce something similar in a different programming language; so I'm trying to understand how Clock.currTime works. According the the documentation Clock.currTime.stdTime should return the number of

Dlangui customize app icon on dock or menu bar

2018-07-25 Thread Ivo via Digitalmars-d-learn
I'm a macOs user and I need to build a application with a GUI. I started using Dlangui with SDL2. I need to be able to call some functions of my program while working with other applications. So I would like to personalize the app icon on the dock so that when right-clicking such icon the

Re: ctRegex not matching correctly at word boundaries

2018-07-08 Thread Ivo via Digitalmars-d-learn
On Sunday, 8 July 2018 at 10:58:24 UTC, rikki cattermole wrote: On 08/07/2018 10:37 PM, Ivo wrote: First of all, I'm not an expert about regular expression syntax, however I believe there might be some strange bug when using ctRegex. Consider the following code: void main() {    

ctRegex not matching correctly at word boundaries

2018-07-08 Thread Ivo via Digitalmars-d-learn
First of all, I'm not an expert about regular expression syntax, however I believe there might be some strange bug when using ctRegex. Consider the following code: void main() { import std.regex: ctRegex, matchFirst; auto expression = ctRegex!("\bis\b"); auto match =