KAZipPacketReceiver (Siena 2.0.4 API Documentation)
Date: 2015-05-17

siena.comm

## Class KAZipPacketReceiver

- java.lang.Object
- - siena.comm.KAPacketReceiver
  - - siena.comm.KAZipPacketReceiver

- All Implemented Interfaces:
    PacketReceiver

      public class KAZipPacketReceiver
      extends KAPacketReceiver

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `Schema`

    - ### Fields inherited from class siena.comm.KAPacketReceiver

      `AcceptPollingInterval, DefaultMaxActiveConnections, DefaultPort, DefaultReceiveTimeout, receive_timeout`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KAZipPacketReceiver()`
    `KAZipPacketReceiver(int port_number)`
    `KAZipPacketReceiver(int port_number, int qsize)`
    `KAZipPacketReceiver(java.net.ServerSocket s)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `address()` external address of this packet receiver.
    `protected static java.net.InetAddress` | `guessMyIPAddress()`
    `protected static java.net.InetAddress` | `guessMyIPAddress(java.net.DatagramSocket s)`
    `protected static java.net.InetAddress` | `guessMyIPAddress(java.net.ServerSocket s)`
    `int` | `receive(byte[] buf)` receives a packet in the given buffer.
    `void` | `setHostName(java.lang.String hostname)` explicitly sets the address of this packet receiver.

    - ### Methods inherited from class siena.comm.KAPacketReceiver

      `receive, receive, setMaxActiveConnections, shutdown`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### Schema

          public static final java.lang.String Schema

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### KAZipPacketReceiver

          public KAZipPacketReceiver()
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### KAZipPacketReceiver

          public KAZipPacketReceiver(int port_number,
                             int qsize)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### KAZipPacketReceiver

          public KAZipPacketReceiver(int port_number)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### KAZipPacketReceiver

          public KAZipPacketReceiver(java.net.ServerSocket s)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### setHostName

          public void setHostName(java.lang.String hostname)

      Description copied from class: `KAPacketReceiver`
      explicitly sets the address of this packet receiver. This method allows users to set the host name or IP address that this receiver advertises as its externally-visible address. This might be necessary in the cases in which the Java VM can not reliably figure out such an address by itself.
      Overrides:
        `setHostName` in class `KAPacketReceiver`

    - #### receive

          public int receive(byte[] buf)
                      throws PacketReceiverException

      Description copied from interface: `PacketReceiver`
      receives a packet in the given buffer. This method must be reentrant. Siena clients and servers must be able to use several threads to receive packets from the same receiver.
      Specified by:
        `receive` in interface `PacketReceiver`
      Overrides:
        `receive` in class `KAPacketReceiver`
      Returns:
        the number of bytes read into the buffer. The return value must not be negative. On error conditions, this method must throw an exception.
      Throws:
        `PacketReceiverException` - in case an error occurrs while reading.

    - #### address

          public byte[] address()

      external address of this packet receiver. Uses the following schema syntax:
      schema`:`host`:`port
      Specified by:
        `address` in interface `PacketReceiver`
      See Also:
        `PacketReceiver.address()`

    - #### guessMyIPAddress

          protected static java.net.InetAddress guessMyIPAddress()
                                                          throws java.net.UnknownHostException

      Throws:
        `java.net.UnknownHostException`

    - #### guessMyIPAddress

          protected static java.net.InetAddress guessMyIPAddress(java.net.ServerSocket s)
                                                          throws java.net.UnknownHostException

      Throws:
        `java.net.UnknownHostException`

    - #### guessMyIPAddress

          protected static java.net.InetAddress guessMyIPAddress(java.net.DatagramSocket s)
                                                          throws java.net.UnknownHostException

      Throws:
        `java.net.UnknownHostException`

Copyright © 2000-2005 University of Colorado.
Copyright © 2005-2011 Antonio Carzaniga.
This documentation is maintained by Antonio Carzaniga