What is Peach
Installing
Tutorials
Methodology
Introduction
FAQ
Peach 3
Peach Pits
 General Conf
 Data Modeling
 State Modeling
 Agents
  Monitors
 Test
  Publishers
  Loggers
Running
Minset
Peach 2.3

License

TcpListener Publisher

The TcpListener publisher is able to listen for incoming connections on a TCP port.

Parameters

  • Interface — IP of interface to bind to

  • Port — Destination port number

  • Timeout — How long to wait in milliseconds for data once a connection has been established (optional, default 3,000)

  • AcceptTimeout — How long to wait in milliseconds for a new connection (optional, default 3,000)

Actions

  • accept — Wait for incoming connection

  • output — Send data to remote host

  • input — Receive data from remote host

Examples

Sending and receiving data
<DataModel name="TheDataModel">
   <String name="value" length="4" />
</DataModel>

<StateModel name="TheState">
        <State name="initial">
                <Action type="accept" />

                <Action type="output">
                        <DataModel ref="TheDataModel"/>
                        <Data>
                                <Field name="value" value="mike" />
                        </Data>
                </Action>

                <!-- receive 4 bytes -->
                <Action type="input">
                        <DataModel ref="TheDataModel"/>
                </Action>
        </State>
</StateModel>

<Test name="Default">
    <!-- ... -->
        <Publisher class="TcpListener">
                <Param name="Interface" value="127.0.0.1" />
                <Param name="Port" value="8080" />
        </Publisher>
</Test>