Operating System - OpenVMS
1831635 Members
1714 Online
110027 Solutions
New Discussion

Re: Canceling request issued by $ICC_CONNECT[W]

 
Ruslan R. Laishev
Super Advisor

Canceling request issued by $ICC_CONNECT[W]

Hi All!

Is there a way to canceling a connect request issued by $ICC_CONNECT[W] routine (like sys$cancel)? Can someone provide any tips&triks?


Thanks in advance!
10 REPLIES 10
Volker Halle
Honored Contributor

Re: Canceling request issued by $ICC_CONNECT[W]

Ruslan,

you seem to be having problems with ICC ;-)

A SYS$ICC_CONNECT[W] either fails immediately or it will hang, until the server issues a SYS$ICC_ACCEPT. There does not seem to be a connect timeout mechanism (tested this with the VERY_SIMPLE_SERVER example and sitting on a breakpoint at conn_ast in the server).

What is the problem you're trying to solve ?
Why would you want to cancel a connect ? Is the server hung ?

Volker.
Ruslan R. Laishev
Super Advisor

Re: Canceling request issued by $ICC_CONNECT[W]

Volker,
I have many problems... :-)

I known that there is not a timeout handling or any other documented way to canceling request, that cause a blocking "client" if a "server" don't issued sys$icc_accept/reject

I just interesting what think about this VMS-guys... ICC is the great stuff (as I told), but need some improving.


PS:Yep, I have tried to solve a problem in threaded application.
Volker Halle
Honored Contributor

Re: Canceling request issued by $ICC_CONNECT[W]

Ruslan,

if you would use the asynchronous form of SYS$ICC_CONNECT and start your own timer AST routine, you could detect the timeout, when the AST is being delivered and prevent your client from hanging on the SYS$ICC_CONNECTW. If the SYS$ICC_CONNECT works, just cancel the timer AST.

You can't cancel the hanging connect, but you could continue in your client - whatever it can do, if the server is hung...

Volker.
Ruslan R. Laishev
Super Advisor

Re: Canceling request issued by $ICC_CONNECT[W]

No I cannot use so "solution", because "client" will issuing new and new connect requests (after some timeout) in case when "server" don't responding very long time...

Moreover, every $icc_connect charging some resources from the process quota.
Volker Halle
Honored Contributor

Re: Canceling request issued by $ICC_CONNECT[W]

Ruslan,

if you remember the 'connect-pending' state in some data structure in the client, you could prevent the client from trying connects all over again. Once the connect-ASTs comes through, just clear the connect-pending flag and the client knows it's now safe to try another connect...

Volker.
Ruslan R. Laishev
Super Advisor

Re: Canceling request issued by $ICC_CONNECT[W]

Yes, sure. I keep "connect-pending" flag in the my mind... But, I dunno what is behaviour of ICC/IPC layer in case when after issued $icc_connect - "server" association will be closed with the $icc_close_assoc...
Volker Halle
Honored Contributor

Re: Canceling request issued by $ICC_CONNECT[W]

Ruslan,

easy ;-)

The client will receive a %SYSTEM-F-REJECT

Again, I've simulated this with the VERY_SIMPLE_SERVER example, set a break on conn_ast and type DBG> exit, so that the server would exit.

You can get the examples from Ask Compaq (NLSA): http://askq.compaq.com/

Just search for ICC EXAMPLE and use the simple one. You can easily answer most of your questions by using these examples in the right way to simulate your scenario.

Volker.
Ruslan R. Laishev
Super Advisor

Re: Canceling request issued by $ICC_CONNECT[W]

May be, may be... I'm not sure.
Volker Halle
Honored Contributor

Re: Canceling request issued by $ICC_CONNECT[W]

Ruslan,

I'm sure ;-)

These ICC routines are pretty low-level functions as you've seen: no timeouts etc.

But they have been written by OpenVMS engineers, so they are at least predictable in behaviour.

I must admit, that I've never used ICC in my life before, but after obtaining the examples, looking through the [IPC] and [TPSSDA] source listings and answering your questions, I'm beginning to feel like an ICC expert. And the behaviour of these routines - once you've understood them - is pretty straightforward - just the way we like it in OpenVMS !

Volker.
Ruslan R. Laishev
Super Advisor

Re: Canceling request issued by $ICC_CONNECT[W]

Volker,
I'm glad to hear that you are "beginning to feel like an ICC expert" after playing with ICC examples. :-)

Anyway thanks.