Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Juergen Sauermann
Hi Elias, if have implemented the *poll() *as a non-default alternative to *select() *in *APserver*. Unfortunately I can't reproduce the problems that I had earlier (they occurred in the middle of development), but I would be surprised if*poll()* would differ from*select() *in that respect.

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Elias Mårtenson
Sorry, not POLLPRI. It's POLLERR or POLLHUP. You can see how it's done here: https://github.com/lokedhs/gnu-apl-mode/blob/master/native/UnixSocketListener.cc#L125 Regards, Elias On 24 July 2014 19:59, Elias Mårtenson wrote: > I believe if you use poll() rather than select(), you should be abl

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Elias Mårtenson
I believe if you use poll() rather than select(), you should be able to detect this state. Add a listener for the event POLLPRI. Regards, Elias On 24 July 2014 19:57, Juergen Sauermann wrote: > Hi Elias, > > given that hardly anybody uses shared variables these days this discussion > is more

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Juergen Sauermann
Hi Elias, given that hardly anybody uses shared variables these days this discussion is more on the theoretical side than of practical relevance. For that reason I would like the solution to be as simple as possible. The extra things needed as you state below make things more complicated and rai

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Elias Mårtenson
I did not know about that feature. Interesting. Also interesting that it's not supported on OSX. That said, I still think Unix domain sockets are good in this case. There are just a few things that needs to be done in order to make them solid. I think I did most of those things in the native code

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Juergen Sauermann
Hi Elias, the idea is this: man 7 unix says: /abstract: an abstract socket address is distinguished by the fact// // that sun_path[0] is a null byte ('\0'). The socket's address in// // this namespace is given by the additional bytes in sun_path that are// //

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Elias Mårtenson
Ah, sorry. My question was about the "+ABSTRACT_OFFSET". That particular addition of the value 1 to the sun_path field was what caused the failure. What I wondered was what is the purpose of ABSTRACT_OFFSET? Regards, Elias On 24 July 2014 19:06, Juergen Sauermann wrote: > Hi Elias, > > Unix D

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Juergen Sauermann
Hi Elias, Unix Domain Sockets were your proposal if I remember correctly :-) . They caused a few extra problems, for example select() does not notice when a connection is closed. Not sure which call you mean? /// Jürgen On 07/24/2014 12:55 PM, Elias Mårtenson wrote: I had never been able to g

Re: [Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Elias Mårtenson
Sorry, I accidentally hit send… Here's the rest: In the following call can be found in bot Svar_DB.cc and the APserver, you can find the following: strcpy(remote.sun_path + ABSTRACT_OFFSET, server_sockname); ABSTRACT_OFFSET is #defined to 1. This means that the first character of the path wi

[Bug-apl] Solved: Unix socket connection failed

2014-07-24 Thread Elias Mårtenson
I had never been able to get APserver to work properly, and particularly not with the Unix Domain Sockets. But, I finally figured it out. :-) In the following call can be found in bot Svar_DB.cc and the APserver.