NAME

Tibco::Rv::Transport - Tibco network transport object

SYNOPSIS

$transport = new Tibco::Rv::Transport;
$msg = $rv->createMessage;
$msg->addString( abc => 123 );
$transport->send( $msg );

DESCRIPTION

A Tibco::Rv::Transport object represents a connection to a Rendezvous daemon, which routes messages to other Tibco programs.

CONSTRUCTOR

$transport = new Tibco::Rv::Transport( %args )
%args:
   service => $service,
   network => $network,
   daemon => $daemon,
   description => $description,
   batchMode => $batchMode

Creates a Tibco::Rv::Transport. If not specified, service defaults to '' (the rendezvous service), network defaults to '' (no network), and daemon defaults to 'tcp:7500' (see your TIB/Rendezvous documentation for discussion on the service/network/daemon parameters). Description defaults to undef, and batchMode defaults to Tibco::Rv::Transport::DEFAULT_BATCH. If Tibco::Rv was built against an Rv 6.x version, then the constructor will die with a Tibco::Rv::VERSION_MISMATCH Status message if you attempt to set batchMode to anything other than Tibco::Rv::Transport::DEFAULT_BATCH.

METHODS

$service = $transport->service

Returns the service setting $transport is connected to.

$network = $transport->network

Returns the network setting $transport is connected to.

$daemon = $transport->daemon

Returns the daemon setting $transport is connected to.

$description = $transport->description

Returns the description of $transport.

$transport->description( $description )

Sets the description of $transport. Description identifies this transport to TIB/Rendezvous components. It is displayed in the browser administration interface.

Although description defaults to undef, if you try to set it to undef, it ends up being '' (this matches the behaviour of the C API, if you consider Perl undef to be equivalent to C NULL, and Perl '' to be equivalent to C "").

$batchMode = $transport->batchMode

Returns the batchMode of $transport. If Tibco::Rv was built against an Rv 6.x version, this method will always return Tibco::Rv::Transport::DEFAULT_BATCH.

$transport->batchMode( $batchMode )

Sets the batchMode of $transport. See the Constants section below for a discussion of the available batchModes. If Tibco::Rv was built against an Rv 6.x version, this method will die with a Tibco::Rv::VERSION_MISMATCH Status message.

$transport->send( $msg )

Sends $msg via $transport on the subject specified by $msg's sendSubject.

$reply = $transport->sendRequest( $request, $timeout )

Sends $request (a Tibco::Rv::Msg) and waits for a reply message. This method blocks while waiting for a reply. $timeout specifies how long it should wait for a reply. Using Tibco::Rv::WAIT_FOREVER causes this method to wait indefinately for a reply.

If $timeout is not specified (or undef), then this method uses Tibco::Rv::WAIT_FOREVER.

If $timeout is something other than Tibco::Rv::WAIT_FOREVER and that timeout is reached before receiving a reply, then this method returns undef.

$transport->sendReply( $reply, $request )

Sends $reply (a Tibco::Rv::Msg) in response to the $request message. This method extracts the replySubject from $request, and uses it to send $reply.

$inbox = $transport->createInbox

Returns a subject that is unique within $transport's domain. If $transport is the Intra-Process Transport, then $inbox is unique within this process; otherwise, $inbox is unique across all processes within the local router domain.

Use createInbox to set up a subject for point-to-point communications. That is, messages sent to this subject will go to a single destination.

createInbox should be used in conjunction with sendReply and sendRequest to enable point-to-point communication, as follows:

On the replying end, create a listener that listens to some subject. In the callback of that listener, create a routine that sends a reply to incoming requests via the sendReply method.

On the requesting end, create an inbox subject using createInbox. Then, create your request message, and use that message's replySubject method to set the reply subject to be the inbox subject you just created. Send that request message via the transport's sendRequest method. The sendRequest method internally creates a listener and waits for the replying end to send a reply.

$transport->DESTROY

Destroy this connection to a TIB/Rendezvous daemon after flushing all outbound messages. Events created with this transport are invalidated. Called automatically when $transport goes out of scope. Calling DESTROY more than once has no effect.

CONSTANTS

Tibco::Rv::Transport::DEFAULT_BATCH

Specifies that the transport should send outbound messages to the TIB/Rendezvous daemon immediately.

Tibco::Rv::Transport::TIMER_BATCH

Specifies that the transport should accumulate outbound messages in a buffer, and send them to the TIB/Rendezvous daemon when either the buffer is full, or a timeout is reached (programs cannot change the timeout interval).

INTRA-PROCESS TRANSPORT

The Intra-Process Transport is a special transport that is automatically created when a new Tibco::Rv object is created. It is available as $Tibco::Rv::Transport::PROCESS. It can only be used to transport messages within the process it was created in. Internal advisory messages are transported via this transport.

SEE ALSO

Tibco::Rv::Msg

AUTHOR

Paul Sturm <sturm@branewave.com>