Getting Started with Streams under HP-UX-10.20

Getting Started with Streams under HP-UX-10.20

Post by Nobod » Tue, 02 Dec 1997 04:00:00



Dear All,

I am having difficulty coming to grips with Streams and require one or two
pointers.
Firstly I want to create a stream between two processes.  I have tried the
example
in Stevens : "UNIX Network Programming" BUT :

a) it doesn't compile : because the book makes use of the /dev/spx driver,
and
b) when I take a wild guess and replace this with /dev/sad it does compile,
but chokes on the readmsg command.

So what I would like to know is :

a) am I using the correct driver?
b) if I am, then why can I not get readmsg to return
c) can anyone recommend a good starting point for streams programming under
HP-UX, since Stevens in this respect appears to be a non-starter.

Secondly, I am only doing this all so that I can get notification of
asynchronous input when one process writes to the other, via a SIGPOLL
signal, is this all in vain?  Having munched my way though Fifos and pipes I
am running out of IPC constructs which support this feature.

with my thanks,

Dominic.

-----
Dominic Varley
Space Division
Logica UK Ltd

 
 
 

Getting Started with Streams under HP-UX-10.20

Post by varley » Tue, 02 Dec 1997 04:00:00


Dear All,
I am having difficulty coming to grips with Streams and require one or two
pointers.
Firstly I want to create a stream between two processes.  I have tried the
example
in Stevens : "UNIX Network Programming" BUT :
a) it doesn't compile : because the book makes use of the /dev/spx driver,
and
b) when I take a wild guess and replace this with /dev/sad it does compile,
but chokes on the readmsg command.
So what I would like to know is :
a) am I using the correct driver?
b) if I am, then why can I not get readmsg to return
c) can anyone recommend a good starting point for streams programming under
HP-UX, since Stevens in this respect appears to be a non-starter.
Secondly, I am only doing this all so that I can get notification of
asynchronous input when one process writes to the other, via a SIGPOLL
signal, is this all in vain?  Having munched my way though Fifos and pipes I
am running out of IPC constructs which support this feature.
with my thanks,
Dominic.
-----
Dominic Varley
Space Division
Logica UK Ltd


 
 
 

Getting Started with Streams under HP-UX-10.20

Post by David Pete » Tue, 02 Dec 1997 04:00:00



> Dear All,

> I am having difficulty coming to grips with Streams and require one or two
> pointers.
> Firstly I want to create a stream between two processes.  I have tried the
> example
> in Stevens : "UNIX Network Programming" BUT :

> a) it doesn't compile : because the book makes use of the /dev/spx driver,
> and
> b) when I take a wild guess and replace this with /dev/sad it does compile,
> but chokes on the readmsg command.

> So what I would like to know is :

> a) am I using the correct driver?
> b) if I am, then why can I not get readmsg to return
> c) can anyone recommend a good starting point for streams programming under
> HP-UX, since Stevens in this respect appears to be a non-starter.

> Secondly, I am only doing this all so that I can get notification of
> asynchronous input when one process writes to the other, via a SIGPOLL
> signal, is this all in vain?  Having munched my way though Fifos and pipes I
> am running out of IPC constructs which support this feature.

> with my thanks,

> Dominic.

> -----
> Dominic Varley
> Space Division
> Logica UK Ltd


Hi Dominic, couldn't you use the FIOASYNC ioctl and friends in
/usr/include/sys/ioctl.h if it's sockets you want to use?

For STREAMS the I_SETSIG ioctl is the one to use. The only manual I know
of is the STREAMS/UX for System 9000 Reference Manual or something like
that. I wouldn't have said it was all that good though.

Also for STREAMS the getmsg and putmsg functions are recommended.
Another thing is that there's not really a great deal of reason to use
the STREAMS package as supplied because as far as I remember it doesn't
come with much in the way of useful modules or drivers (this is for 9.x.
Perhaps it's a lot better on 10.x). The only really useful things that
STREAMS gives you (unless you intend to write your own modules or
drivers) is promiscuous mode on ethernet and access to token-ring (and
FDDI I guess).

                        Regards

                                Dave
--
David Peter                      | A repo man is always intense.
Insignia Solutions plc           | But only a fool gets killed

Voice: +44 (0)1494 453351        | http://www.insignia.com

 
 
 

Getting Started with Streams under HP-UX-10.20

Post by varley » Tue, 02 Dec 1997 04:00:00




>> Dear All,

>> I am having difficulty coming to grips with Streams and require one or
two
>> pointers.
>> Firstly I want to create a stream between two processes.  I have tried
the
>> example
>> in Stevens : "UNIX Network Programming" BUT :

>> a) it doesn't compile : because the book makes use of the /dev/spx
driver,
>> and
>> b) when I take a wild guess and replace this with /dev/sad it does
compile,
>> but chokes on the readmsg command.

>> So what I would like to know is :

>> a) am I using the correct driver?
>> b) if I am, then why can I not get readmsg to return
>> c) can anyone recommend a good starting point for streams programming
under
>> HP-UX, since Stevens in this respect appears to be a non-starter.

>> Secondly, I am only doing this all so that I can get notification of
>> asynchronous input when one process writes to the other, via a SIGPOLL
>> signal, is this all in vain?  Having munched my way though Fifos and
pipes I
>> am running out of IPC constructs which support this feature.

>> with my thanks,

>> Dominic.

>> -----
>> Dominic Varley
>> Space Division
>> Logica UK Ltd

>Hi Dominic, couldn't you use the FIOASYNC ioctl and friends in
>/usr/include/sys/ioctl.h if it's sockets you want to use?

>For STREAMS the I_SETSIG ioctl is the one to use. The only manual I know
>of is the STREAMS/UX for System 9000 Reference Manual or something like
>that. I wouldn't have said it was all that good though.

>Also for STREAMS the getmsg and putmsg functions are recommended.
>Another thing is that there's not really a great deal of reason to use
>the STREAMS package as supplied because as far as I remember it doesn't
>come with much in the way of useful modules or drivers (this is for 9.x.
>Perhaps it's a lot better on 10.x). The only really useful things that
>STREAMS gives you (unless you intend to write your own modules or
>drivers) is promiscuous mode on ethernet and access to token-ring (and
>FDDI I guess).

> Regards

> Dave
>--
>David Peter                      | A repo man is always intense.
>Insignia Solutions plc           | But only a fool gets killed

>Voice: +44 (0)1494 453351        | http://www.insignia.com

Dave,

thanks for your thoughts, I am already planning to use the asynchronous
signalling facilities for my sockets.  However, I am implementing this under
X/Open sockets which is fine across hosts.  However, within a single host,
if I have read the manuals correctly, X/Open doesn't support UNIX domain
sockets, or an equivalent thereof.  Not wishing to invoke a whole TCP
communication session within a single host I have been looking at
alternatives; Fifo, Pipes and finally Streams.  Experiments have shown that
asynchronous signalling doesn't work for the first two, and my "last, best
hope" - streams - doesn't even get off of the ground.

I basically want to do a mknod, a signal, and an interupt handler which does
the readmsg for me.  But I can't get the mknod, readmsg up and running.

thanks,

Dominic.
-----
Dominic Varley
Space Division
Logica UK Ltd

 
 
 

Getting Started with Streams under HP-UX-10.20

Post by Mike Krau » Tue, 02 Dec 1997 04:00:00


: a) it doesn't compile : because the book makes use of the /dev/spx driver,

This driver is not delivered by HP-UX.
: and
: b) when I take a wild guess and replace this with /dev/sad it does compile,
: but chokes on the readmsg command.

/dev/sad is the STREAMS admin driver and would not work for anything but
admin ops such as autopush.

: So what I would like to know is :
: a) am I using the correct driver?

No.

: b) if I am, then why can I not get readmsg to return
: c) can anyone recommend a good starting point for streams programming under
: HP-UX, since Stevens in this respect appears to be a non-starter.
: Secondly, I am only doing this all so that I can get notification of
: asynchronous input when one process writes to the other, via a SIGPOLL
: signal, is this all in vain?  Having munched my way though Fifos and pipes I
: am running out of IPC constructs which support this feature.
: with my thanks,

You could try streams-based pipes (kernel tunable) which would change normal
in-memory pipes to be implemented within STREAMS.  There is a performance delta
associated with doing so (-20-25%).  You could then use this as a comms mech
between two processes.  

You could use the local loopback driver (/dev/echo) as an alternative.

BTW, the Rago Book is the best book for learning STREAMS from and most of
the work is fairly portable across STREAMS implementations but not everything
in the book is on every Unix platform since most of the modules described must
be compiled and added to the kernel for access.

 
 
 

1. Linking aCC (HP-UX-10.20) and CC (HP-UX 9.X)

I am in the bad situation that I have to link under HP-UX 10.20
my code with old libraries
that where created with CC under HP-UX 9.X.

When I link (under HP-UX 10.20, using aCC),
I obtain at run time:

Unresolved symbol: __pure_virtual_called (code)
from libXXX.sl

When I add libC to the link library list,
I obtain (again at run-time)

Unresolved symbol: __head (data) from libC
Unresolved module for symbol: _main(code) from mymainprogram.

Can someone explain to me what is going on?
Is there any proper solution?

Thank you

Helmut Zeisel

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. MACPPP problems on a powerbook

3. Passive FT client for HP-UX 10-20

4. 32-bit PC-Pine: attachment filenames

5. A CRON PBLM ON HP-UX 10 20

6. MPEG-FAQ: multimedia compression [2/6]

7. Problem with HP-UX 10.210.20 V Compiler

8. CPU Scheduling in HP-10.20

9. install java-jdk1.1.5 on hp-unix-machine vers.10/20

10. TCP_NODELAY for HP-UX 10.0x (Still getting a delay?)

11. Problem starting NFS client subsystem on HP-UX10.20

12. UX-10 - why streams pty's?