[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference help::osi_appl_support

Title:Please read note 1.0ELP::OSI_APPL_SUPPORT
Notice:Please read note 1.0
Moderator:DRAGNS::MILLERCOM::S_WATTUM
Created:Mon Aug 30 1993
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:516
Total number of notes:2729

516.0. "OSAK API - intended behaviour ?" by BIKINI::DITE (John Dite@RTO DTN 865-4065) Thu Jun 05 1997 06:00

Can you clarify whether this is the intended behaviour as the documentation
does not necessarily imply this.

We have an OSAK(UNIX) application using the Redirection services.

The OSAK server progam 			the OSAK Responder program 
(our Redirector) 
	
osak_open_responder
osak_give_buffers
do until
   osak_select
   osak_get_event
   if A-Associate Indication
   then 
	start subprocess		osak_open_redirect 	
	osak_redirect			osak_give_buffers
   else					if Redirect Indication
	....				then 	
   endif				    osak_accept_response
					    ....
					else
					    ....
					endif

					osak_close_port


The OSAK programming reference manual states that after a 'osak_redirect'
has been issued that a osak_close_port should be called as the original
port that the process has used is invalid. 

We however call osak_select and receive via osak_get_event a new or queued
Association using the same port #. 

Everything seems to work a treat. 

John
T.RTitleUserPersonal
Name
DateLines
516.1RMULAC::S_WATTUMScott Wattum - FTAM/VT/OSAK Engineering (303) 840-2986Thu Jun 05 1997 09:4913
Just lucky.

On OpenVMS, you no longer own the redirected I/O channel because of the way OSI
Transport works, thus the port would be invalid after the redirect.  On UNIX the
redirect mechanism is very different and the fd that you used is still available
for additional inbound connects.  Also, at a very quick glance there are error
conditions which can cause the UNIX port to become invalid if the redirect
operation fails.

I would say that to be "safe" you should treat the port in the manner that the
documentation suggests - close it after a redirect.

--Scott
516.2known problemDRAGNS::MILLERValerie MillerThu Jun 05 1997 11:3916
    
    This problem -- cannot close port after redirect on UNIX -- was known
    by the former OSAK team.  The description that they left is:
    
    "After issuing a successful redirect request an application cannot close
    the port (unless it specifies destructive). No transport disconnect
    indication is received."
    
    Supposedly, this problem was release-noted at some point.
    
    This problem is on our to-do list at a low priority.  If you want it
    moved up on the priority list, please enter an IPMT.
    
    Valerie Miller
    osi applications/osak engineering
    
516.3At least 2 osak_open_responders required ?BIKINI::DITEJohn Dite@RTO DTN 865-4065Fri Jun 06 1997 07:5117
Scott, Valerie 

	thanks for your input.

The release notes include information regarding the 'destructive' closing of 
the redirected port.

So basically what we have to in our application is to ensure that we issue
a second osak_open_responder before we close the previous port that has just
been redirected? 

I assume OSAK queues any incoming OSAK Associate-requests and passes them onto
the application with the first port # for which an OSAK_GET_EVENT is issued?

How does FTAM on Digital UNIX do it?

John
516.4RMULAC::S_WATTUMScott Wattum - FTAM/VT/OSAK Engineering (303) 840-2986Fri Jun 06 1997 10:1238
>before we close the previous port that has just
>been redirected? 

Or pre-open a number of ports.

>I assume OSAK queues any incoming OSAK Associate-requests and passes them onto
>the application with the first port # for which an OSAK_GET_EVENT is issued?

I don't remember if the mechanism is fifo or filo.  I do know that you can use
filo to make some delicious food though.

>How does FTAM on Digital UNIX do it?

The FTAM listener may not be a good example, it's hard to tell who wrote it, but
it looks like someone was learning C at the time.

Anyway, as I glance thru the code......
The ftam listener pre-opens the number of ports specified by the qlen value when
the listener is started.  Then, as each port is redirected, a new port is
opened to replace it:  The FTAM listener code is actually pretty ugly, they walk
the entire list of ports looking for an event (osak_select() w/timeout=0), and
then if no events are found, it blocks in osak_select() on the last port.  So I
guess it's a lifo queue (I'm not sure that behaviour is documented in OSAK, and
so I'd be cautious of using it - I think it would be better to simply pass all
the ports into osak_select() and then figure out which port had the event after
osak_select() returned).  Once a port with an event is found, it's given a
buffer and osak_get_event() is called - if the event is an association
indication then we fork/exec a child and redirect the association to the child;
at which point the port is destructively closed, and a new port opened.

VT on OpenVMS does a similar thing as the FTAM listener, but just passes the
entire list of ports into osak_select() and then walks the list looking for
any/all ports with an event - this removes the dependency on the lifo behaviour
and actually makes the code simpler, since the FTAM listener must poll the
entire list once to see if an event may have happened on the most recent port at
a particular point in time, when the listener was starting.

--Scott