From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,e83f555f2f79b001 X-Google-Attributes: gid1164f8,public From: Steven Cox Subject: Re: X.25 for Digital UNIX Date: 1998/04/16 Message-ID: <3535B382.908C60F2@vega.co.uk>#1/1 X-Deja-AN: 344586729 Content-Transfer-Encoding: 7bit X-NNTP-Posting-Host: hamlet.vega.co.uk:194.217.20.10 References: <3534717D.C7582E76@vega.co.uk> <3534C83B.6818@vf.vodafone.co.uk> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 892711981 nnrp-07:3853 NO-IDENT hamlet.vega.co.uk:194.217.20.10 Organization: VEGA Group Plc. MIME-Version: 1.0 Newsgroups: comp.sys.dec Paul Black wrote: > > I don't think it uses standard file descriptors. The way we handled this > is to do a poll() for 1 second then to do a non-blocking poll on the X25 > side for each open port. To be honest, it is messy. In the software > being > developed, it has to handle up to 120 X25 connections - I'm waiting to > see how well the approach we've taken scales. > > A contingency plan would be to create the X.25 stuff in another process, > fork that and have one writing and one reading the X.25 stuff in > blocking > mode and communicating with the orignal parent through pipes. I'm not > sure > of the gotchas hiding in that idea. > The software is already forked as another process. There are 255 simulated devices, connected in a mesh. Of these, 3 can be real (requiring real X.25 links). A total of 765(!) X.25 links are required, and so 765 processes are required (since our software uses a concept of microservers to stop the simulator being blocked). Luckily we have a beefy computer to cope with this (and the simulation, and the TCP/IP links...). We hope. The only gotchas we have found in that idea is where a blocking function in the microserver process will make it tricky to see if a command, or data has been sent to it. By sending data down a pipe from the simulator to a microserver, and then following this with a SIGUSR1 signal, the microserver will interupt, and the appropriate action can be taken. > > I have also tried sending SIGUSR1 to the process, but this just > > interupts the X25 call with an undefined error (not X25RC_SYSERR with > > errno set to SIGUSR1 as I was informed). > > Is errno set to EINTR (interrupted system call)? > > Paul After experimentation, I noticed that errno is set to EINTR. Since we only trap the SIGUSR1 signal in the microserver, checking to see if the return value from any blocking X.25 library function is EINTR should be a safe way of telling if the SIGUSR1 signal has been sent. Cheers for the help, it seems that the problem is solved!! Ace. Steve.