
DatagramWriter |
ptolemy.actor.lib.net.DatagramWriter |
This actor sends its input as a Datagram over the network using the
UDP protocol. Before being sent, the data is optionally encoded as a
text string representing the value being sent. When this option is
selected, any Ptolemy data type may be represented.
See the <i>encoding</i> parameter.
<p>The address and socket number towards which the datagram is sent
are given by the optional inputs <i>remoteAddress</i> and
<i>remoteSocketNumber</i>. However, unless/until token(s) arrive at
these inputs, default values, given by <i>defaultRemoteAddress</i> and
<i>defaultRemoteSocketNumber</i> are used. Note that some IP
addresses are special broadcast addresses. An address such as
"128.32.239.255" broadcasts to any IP addresses on the "128.23.239.X"
subnet. This only works on your own subnet.
<p>Each instance of this actor needs to allocate a local socket from
which to transmit datagrams. Initially, the local socket number is
set to 4003, just to pick a number. The socket is not allocated
until the model is run.
Author(s): Winthrop Williams, Joern Janneck, Xiaojun Liu, Edward A. Lee
(Based on TiltSensor actor written by
Chamberlain Fong, Xiaojun Liu, Edward Lee)
Version:$Id: DatagramWriter.doc.html,v 1.1 2006/02/22 18:40:26 mangal Exp $
Pt.Proposed Rating:Yellow (winthrop)
Pt.Accepted Rating:Yellow (winthrop)
triggerOutput
The triggerOutput port. The type of this port is GENERAL,
forcing input ports connected here to also be of type GENERAL,
(as trigger inputs typically are). This port always transmits
a Token with nothing in it. This gives the designer a way to
control the order in which other actors fire with respect to
the firing of this actor in the SDF domain.
data
Data to be sent. Data can be encoded different ways,
depending on the setting of <i>encoding</i>.
remoteAddress
The remote address towards which to launch the packet.
This is a multiport. This permits it to be left unconnected in DE.
If multiple addresses are delivered simultaneously to this port,
the one arriving via the highest numbered channel is used.
Type is string.
remoteSocketNumber
The remote socket number towards which to launch the packet.
This is a multiport. This permits it to be left unconnected in DE.
If multiple addresses are delivered simultaneously to this port,
the one arriving via the highest numbered channel is used.
Type is integer.
localSocketNumber
The local socket number for this actor's socket. Integer in
the range 0..65535. Default is 4003.
defaultRemoteAddress
The default remote address to which to send datagrams.
This is a string. It will get looked up to find the IP address.
(Legal forms of this string include "128.32.239.10" and "localhost".)
defaultRemoteSocketNumber
The default remote UDP socket to which to launch the packet.
This is an integer in 0..65535. NOTE: TCP sockets
get their own distinct, non-interfering, set of 2^16 numbers!