Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Hey, all. I have just started using D and I'm really loving it, but I have been caught on a problem. I am trying to share my Client class to a new thread, and after a bit of struggling: I finally got the code to compile! Now I am having a new problem: the moment I call client.receive(buf) I get

Re: Struggling with shared objects

2015-01-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, January 17, 2015 21:56:56 Mike via Digitalmars-d-learn wrote: Ha, I am so stupid! I forgot to call the socket member before receive! Thank you for the help. I have also removed the pointers. I am now getting this: C:\Users\Michael\Documents\Projects\StompBroker\StompBrokerdmd

Re: Struggling with shared objects

2015-01-17 Thread Vlad Levenfeld via Digitalmars-d-learn
That's real weird. In D:\D\dmd2\src\phobos\std\concurrency.d(13,13) 13,13 isn't a line number and static assertions should go off during compilation, not runtime.

Re: Struggling with shared objects

2015-01-17 Thread anonymous via Digitalmars-d-learn
On Saturday, 17 January 2015 at 21:00:34 UTC, Mike wrote: Hey, all. I have just started using D and I'm really loving it, but I have been caught on a problem. I am trying to share my Client class to a new thread, and after a bit of struggling: I finally got the code to compile! Now I am

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Ha, I am so stupid! I forgot to call the socket member before receive! Thank you for the help. I have also removed the pointers. I am now getting this: C:\Users\Michael\Documents\Projects\StompBroker\StompBrokerdmd main.d main.d(11): Error: None of the overloads of 'receive' are callable

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
On Saturday, 17 January 2015 at 21:12:34 UTC, Vlad Levenfeld wrote: That's real weird. In D:\D\dmd2\src\phobos\std\concurrency.d(13,13) 13,13 isn't a line number and static assertions should go off during compilation, not runtime. It is during compilation. When I run dmd myself, I get this:

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Oh, I said the moment I call I should have reworded that. I meant that the moment I add that line to the code, I get the error. Sorry!

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Thank you so much! I got it all working now. You're definitely right, that is still easier than C++.