Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* X.25 for Digital UNIX
@ 1998-04-15  4:00 Steven Cox
  1998-04-15  4:00 ` Paul Black
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Cox @ 1998-04-15  4:00 UTC (permalink / raw)



I don't know if anyone can help, but I am developing a peice of
software using the X.25 for Digital UNIX library (version 3.0).  I am
required to send/receive data from the X.25 link created by my process
to the parent process via a pipe, which is also used to receive commands
from the parent process.

The problem is, is that a blocking read of the X.25 port is required so
that the port does not need to be continuously polled.  The only way to
receive commands from the parent process is by interupting this X25lib
call.  I have been told that I could use select for this (by setting it
to interupt if data is present on the pipe or on the X.25 link).  I this
possible?  Does the X.25 library use standard UNIX file descriptors?
(I am pretty certain it does not - the file descriptor returned by the
X25 library calls in my test program is 3 - I'd expect more UNIX files
to be open - is this a dumbass way of telling?)

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).

Can anyone help me????!!?


Cheers,

Steve Cox.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: X.25 for Digital UNIX
  1998-04-15  4:00 X.25 for Digital UNIX Steven Cox
@ 1998-04-15  4:00 ` Paul Black
  1998-04-16  4:00   ` Steven Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Black @ 1998-04-15  4:00 UTC (permalink / raw)



Steven Cox <steven.cox@vega.co.uk> wrote:
> 
> I don't know if anyone can help, but I am developing a peice of
> software using the X.25 for Digital UNIX library (version 3.0).  I am
> required to send/receive data from the X.25 link created by my process
> to the parent process via a pipe, which is also used to receive commands
> from the parent process.

Is this X.25 V3 for Digital Unix (V??) or is it X.25 (V2?) for DU 3?
The stuff I mention below is for the latter.


> The problem is, is that a blocking read of the X.25 port is required so
> that the port does not need to be continuously polled.  The only way to
> receive commands from the parent process is by interupting this X25lib
> call.  I have been told that I could use select for this (by setting it
> to interupt if data is present on the pipe or on the X.25 link).  I this
> possible?  Does the X.25 library use standard UNIX file descriptors?
> (I am pretty certain it does not - the file descriptor returned by the
> X25 library calls in my test program is 3 - I'd expect more UNIX files
> to be open - is this a dumbass way of telling?)

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.


> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: X.25 for Digital UNIX
  1998-04-15  4:00 ` Paul Black
@ 1998-04-16  4:00   ` Steven Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Cox @ 1998-04-16  4:00 UTC (permalink / raw)



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.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-04-16  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-04-15  4:00 X.25 for Digital UNIX Steven Cox
1998-04-15  4:00 ` Paul Black
1998-04-16  4:00   ` Steven Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox