Re: How can I wrap SSL on Dlang Socket?

2020-11-15 Thread frame via Digitalmars-d-learn
On Monday, 16 November 2020 at 01:25:01 UTC, Marcone wrote: How can I wrap SSL on Dlang Socket like I wrap in Python? There is no functionality in the standard library. If you are just looking for a HTTP client, use std.net.curl. If you want your own thing or need a server application you

Issue with opening files on VSCode "D Language utility extension pack"

2020-11-15 Thread data pulverizer via Digitalmars-d-learn
Hi All, On VS Code "D Language utility extension pack", I notice that if I open a random D file, on the bottom left of the IDE, a message says "D: workspace/(0.0%): starting up...". It stays at 0.0% and doesn't go away and gives the impression that it is broken. Opening a file through a

How can I wrap SSL on Dlang Socket?

2020-11-15 Thread Marcone via Digitalmars-d-learn
How can I wrap SSL on Dlang Socket like I wrap in Python?

Re: How can execute method in new Thread?

2020-11-15 Thread Bastiaan Veelo via Digitalmars-d-learn
On Saturday, 14 November 2020 at 17:21:15 UTC, Marcone wrote: Error: D:\dmd2\windows\bin\..\..\src\phobos\std\parallelism.d(516): Error: struct `Fruit` does not overload () I think you need to pass the this pointer somehow. This works: import std; struct Fruit { string name;

Re: How can execute method in new Thread?

2020-11-15 Thread frame via Digitalmars-d-learn
On Saturday, 14 November 2020 at 17:21:15 UTC, Marcone wrote: Error: D:\dmd2\windows\bin\..\..\src\phobos\std\parallelism.d(516): Error: struct `Fruit` does not overload () You can't. Because everything that can run in a new thread must be a (separate) function. If you are using an object

extern(C) Variant: attempting to use incompatible types int and int

2020-11-15 Thread frame via Digitalmars-d-learn
I know the problem that TypeInfo != TypeInfo in main and library context. Is there are a hack to get the data from the Variant even if the TypeInfo-check fails? I assume the only workaround is using an own struct or serializer to achieve the same functionality?

Re: How can I set Timeout of Socket?

2020-11-15 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 15 November 2020 at 00:05:08 UTC, Marcone wrote: Socket s = new Socket(AddressFamily.INET, SocketType.STREAM); s.connect(new InternetAddress("domain.com", 80)); I want that program raise an error if reach for example 30 seconds of timeout. My program does something like this.

Re: How format UnixTime to "%Hh:%Mm:%Ss" ?

2020-11-15 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 15 November 2020 at 03:14:07 UTC, Marcone wrote: I want to convert seconds to hour, minut and second. Do you want to convert a *duration* into hours/minutes/seconds, or format a UNIX *timestamp* to hours/minutes/seconds? These are conceptually two different things.

Re: magically a static member on init?

2020-11-15 Thread Martin via Digitalmars-d-learn
On Sunday, 15 November 2020 at 00:29:41 UTC, H. S. Teoh wrote: if you don't like the semantics, don't use it; always allocate the field in the class ctor instead. Hi, i neither like it nor dislike it - it just caught me by surprise because i was under the impression that if i create a new