listenAsynch

listenAsynch(receiver: Object;
             msg:      String);

The listenAsynch method of the NamedPipe class offers a connection to a remote application and returns immediately.

The listenAsynch method can be called only when the value of the Connection superclass state property is Disconnected (0).

When the listenAsynch method is called, the value of the state property is changed to Connecting (1).

An exception is raised if this method is invoked from a server method when the server node is not running under a Windows operating system that supports services.

When the connection is established, the callback method name specified in the msg parameter is called for the receiver object. The callback method must match the signature required by the calling listenAsynch method, as follows.

listenCallback(pipe: NamedPipe);

The connection is established by opening a pipe name using the contents of the Connection superclass name property. Each end of the named pipe must open the pipe by using the same name.

The Connection superclass fillReadBuffer property determines whether the pipe is opened in bytes or in message mode. Both ends of the pipe must use the same mode.

The value of the state property changes to Connected (2) when the connection is open.

Multiple instances of the pipe can be opened by the same process or by multiple copies of the JADE application running from the same jade.exe executable program.

If the close method is called before a connection is made, the listenAsynch callback routine is not called. If the listenAsynch method call fails, a connection exception is raised.