Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 4_12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.co.westhawk.snmp.net
Interface ContextSocketFace

All Known Implementing Classes:
  NetscapeSocket, StandardSocket, KvmSocket

public interface ContextSocketFace

The interface for the different type of sockets.

Version:
  $Revision: 1.7 $ $Date: 2002/10/10 15:13:57 $
Author:
  Tim Panton

Field Summary
`static java.lang.String` | `version_id`

Method Summary
`void` | `close()` Closes this socket.
`void` | `create(int port)` Creates the socket.
`void` | `create(java.lang.String host, int port)` Creates the socket.
`java.lang.String` | `getHostAddress()` Returns the IP address of the host of the packet we received.
`java.io.ByteArrayInputStream` | `receive(int maxRecvSize)` Receives a packet from this socket.
`void` | `send(byte[] packet)` Sends a packet from this socket.

Field Detail

### version_id

    public static final java.lang.String version_id

Method Detail

### create

    public void create(int port)
                throws java.io.IOException

  Creates the socket. This socket is used when listening for traps. Use only one (1) of the two create methods.
  Parameters:
    `port` - The local port number were we receive (listen for) packets.
  See Also:
    `create(String, int)`

### create

    public void create(java.lang.String host,
                       int port)
                throws java.io.IOException

  Creates the socket. This socket is used to send out our requests. Use only one (1) of the two create methods.
  Parameters:
    `host` - The name of the host that is to receive our packets
    `port` - The port number of the host
  See Also:
    `create(int)`

### getHostAddress

    public java.lang.String getHostAddress()

  Returns the IP address of the host of the packet we received. This will be used when we are listening for traps.
  Returns:
    The IP address, or null when the hostname cannot be determined

### receive

    public java.io.ByteArrayInputStream receive(int maxRecvSize)
                                         throws java.io.IOException

  Receives a packet from this socket.
  Parameters:
    `maxRecvSize` - the maximum number of bytes to receive
  Returns:
    the packet as ByteArrayInputStream

### send

    public void send(byte[] packet)
              throws java.io.IOException

  Sends a packet from this socket.
  Parameters:
    `packet` - the packet

### close

    public void close()

  Closes this socket.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 4_12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD