NewWait4Port
Documentation

Contents:

	Introduction			What is it all about ?
	Features				What's so special with NewWait4Port ?
	Installation			How to make it work
	Usage				How to use it
	Bugs				No program is perfect
	History				Have a look back
	Contact				How you can get in contact with me

Introduction

So what does it do ?

NewWait4Port is a replacement of the WaitForPort command provided with Amiga-OS. It waits for a Message Port to appear and then end itself. This is useful for batch scripts. Here's an example:

run <>NIL: Miami:Miami		;start Miami TCP/IP-Stack as background task
NewWait4Port MIAMI.1		;wait for its Msg port to appear
rx "ADDRESS MIAMI.1 ONLINE"	;send a rexx command to this port

This script waits till Miami has been started and its ARexx Port is available. Then it tells Miami to go online. Without NewWait4Port you would try to send a rexx message before the Port is available as it needs some time for Miami to start. Of course you could use a simple  wait 5 . But you never really know how long Miami will need to start.

Features

The original WaitForPort command of Amiga-OS has two major disadvantages:

·it ends itself if the port isn't available within 10 seconds.

·it uses an endless loop of FindPort() calls resulting in a massive loss of CPU  performance.

NewWait4Port waits for the Port to appear even if it has to wait for hours. It also allows you to define a delay time between FindPort() calls preventing a loss of CPU performance.

Installation

Nothing's as simple as that.

Copy NewWait4Port to sys:rexxc/
Rename it to WaitForPort if you like.

Copy the documentation to wherever you want.

Usage

PORT/A   DELAYTICKS/N

PORT/A		is the name of the message port to wait for. This argument must be provided. If the name includes spaces you need to enclose it with "". Consider that Amiga-OS port names are case sensitive !

DELAYTICKS/N 	is the delay time between the single FindPort() calls. The value given must be the number of 1/50 seconds (=1 tick).
				Defaults to 0 (behaviour of the original WaitForPort command). 25 is probably a good value here.

Example:

 NewWait4Port MIAMI.1 10    ; waits for MIAMI.1 port to appear. It checks its   availability every 10/50 second (=200 milli seconds).

If you start NewWait4Port without any arguments Amiga-DOS will show you the template and ask you for input. If you input a ? now you will get a more detailed explanation of the arguments.

You can cancel NewWait4Port by sending a CTRL_C break. This can be done by pressing Ctrl C or by the following commandline:

 break `status COM=newwait4port` C

Note that it can take up to DELAYTICKS time for the program to quit as the program cannot quit within a Delay() call.

Bugs

No bugs known (so far...).
Tell me if you find one.

History

1.00 First Version, first Aminet Release

Copyright Notice

©1999 by Jean Holzammer

This Programm is Freeware.

You may use it for free for private and commercial use.

You may distribute it as long as you provide the full and unmodified archive.

If you distribute it commercially you may not charge more than 1 EUR per disc or 5 E per CD-ROM.

Otherwise you need my explicit permission.

Permission is hereby granted to Aminet CD-ROMs and Aminet Set CD-ROMs.

Contact information

Do you want to report bugs, make suggestions or show me you like this product you can contact me at

       jholzammer@bene.baynet.de

snailmail:

          Jean Holzammer
          Ringstraße 20
          92369 Sengenthal
          Germany

fax: (0049 for Germany) 089/6661 713 498

http://Jean.Holzammer.home.pages.de

You can also contact me if you are interested in the source of the programm.

Thanks to:
·Wouter van Oortmerssen	for his implementation of the E language.
·Dietmar Eilert			for the best text editor available on any platform.
·Urban Müller and his team	for the Aminet that initiated a boom of freely available software.
·Richard Körber			for GuideML.
·everyone else supporting the idea of free software and open source technology.