Re: Howto catch SocketOSException?

2017-03-27 Thread Jolly James via Digitalmars-d-learn
On Sunday, 26 March 2017 at 21:57:29 UTC, Jolly James wrote: On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote: [...] If you want try to help me, mabye this helps you: https://github.com/CyberShadow/ae/blob/master/net/asockets.d#L1237 Finally found the bug: I had a logical error in the

Re: Howto catch SocketOSException?

2017-03-26 Thread Jolly James via Digitalmars-d-learn
On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote: On Sunday, 26 March 2017 at 11:46:39 UTC, Jolly James wrote: [...] Chances are it's invoked in another thread and thus you can't catch it like that. To sum it up. Ex. void thisFunctionThrows() { ... } void ableToCatch() { try {

Re: Howto catch SocketOSException?

2017-03-26 Thread bauss via Digitalmars-d-learn
On Sunday, 26 March 2017 at 11:46:39 UTC, Jolly James wrote: On Sunday, 26 March 2017 at 11:35:00 UTC, Jolly James wrote: [...] Found out something: You cannot catch any exception thrown in the listen()-method in general. ■ Original code: [...] ■ Modified one: [...] ■ Not working

Re: Howto catch SocketOSException?

2017-03-26 Thread Jolly James via Digitalmars-d-learn
On Sunday, 26 March 2017 at 11:35:00 UTC, Jolly James wrote: On Sunday, 26 March 2017 at 02:41:46 UTC, Adam D. Ruppe wrote: On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote: You can ignore the loop()-method. It is not called as the application will never reach this statement,

Re: Howto catch SocketOSException?

2017-03-26 Thread Jolly James via Digitalmars-d-learn
On Sunday, 26 March 2017 at 02:41:46 UTC, Adam D. Ruppe wrote: On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote: You can ignore the loop()-method. It is not called as the application will never reach this statement, because it cannot, because it crashes already in the

Re: Howto catch SocketOSException?

2017-03-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote: You can ignore the loop()-method. It is not called as the application will never reach this statement, because it cannot, because it crashes already in the listen()-method in consequence of the exception that does not get caught by

Re: Howto catch SocketOSException?

2017-03-25 Thread Jolly James via Digitalmars-d-learn
On Sunday, 26 March 2017 at 01:22:24 UTC, bauss wrote: On Sunday, 26 March 2017 at 00:34:03 UTC, Jolly James wrote: [...] This part: catch (std.socket.SocketOSException e) [...] [...] I know that inheritance stuff, but none (!) of them catches that strange exception either. You can

Re: Howto catch SocketOSException?

2017-03-25 Thread bauss via Digitalmars-d-learn
On Sunday, 26 March 2017 at 00:34:03 UTC, Jolly James wrote: How do you catch an std.socket.SocketOSException? The following does not work, as the exception occurs anyway and leads to a crash: import ae.net.asockets; void main(string[] args) { TcpServer tcp = new TcpServer();

Howto catch SocketOSException?

2017-03-25 Thread Jolly James via Digitalmars-d-learn
How do you catch an std.socket.SocketOSException? The following does not work, as the exception occurs anyway and leads to a crash: import ae.net.asockets; void main(string[] args) { TcpServer tcp = new TcpServer(); try { tcp.listen(2345,