Holger's Java API

## com.antelmann.net
Class SimpleHandshake

    java.lang.Object
      com.antelmann.net.SimpleHandshake

All Implemented Interfaces:
  Handshake

    public class SimpleHandshake

extends Object
implements Handshake

Since:
  06/27/06
Author:
  Holger Antelmann

Constructor Summary
`SimpleHandshake(char[] signature)` uses an infinite soTimeout (0)
`SimpleHandshake(char[] signature, int soTimeout)`
`SimpleHandshake(String signature)` uses an infinite soTimeout (0)
`SimpleHandshake(String signature, int soTimeout)`

Method Summary
`void` `clientHandshake(NetConnection con)` performs a handshake for the given socket on behalf of a client
`Object` `getHandshakeAnswer(Object question)` hashes a combination of the question and the signature
`Object` `getHandshakeQuestion()` generates a random String
`String` `getIdentificationString()` returns a hashed version of the signature given in the constructor
`int` `getSoTimeout()`
`void` `serverHandshake(NetConnection con)` performs a handshake for the given socket on behalf of a server
`void` `setSoTimeout(int soTimeout)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleHandshake

    public SimpleHandshake(String signature)

  uses an infinite soTimeout (0)

### SimpleHandshake

    public SimpleHandshake(char[] signature)

  uses an infinite soTimeout (0)

### SimpleHandshake

    public SimpleHandshake(String signature,
                           int soTimeout)

### SimpleHandshake

    public SimpleHandshake(char[] signature,
                           int soTimeout)

Method Detail

### getIdentificationString

    public String getIdentificationString()

  returns a hashed version of the signature given in the constructor

  Specified by:
    `getIdentificationString` in interface `Handshake`

### getSoTimeout

    public int getSoTimeout()

### setSoTimeout

    public void setSoTimeout(int soTimeout)

### getHandshakeAnswer

    public Object getHandshakeAnswer(Object question)

  hashes a combination of the question and the signature

  Specified by:
    `getHandshakeAnswer` in interface `Handshake`

### getHandshakeQuestion

    public Object getHandshakeQuestion()

  generates a random String

  Specified by:
    `getHandshakeQuestion` in interface `Handshake`

### serverHandshake

    public void serverHandshake(NetConnection con)
                         throws IOException,
                                HandshakeException

  Description copied from interface: `Handshake`
  performs a handshake for the given socket on behalf of a server

  Specified by:
    `serverHandshake` in interface `Handshake`
  Throws:
    `IOException`
    `HandshakeException`

### clientHandshake

    public void clientHandshake(NetConnection con)
                         throws IOException,
                                HandshakeException

  Description copied from interface: `Handshake`
  performs a handshake for the given socket on behalf of a client

  Specified by:
    `clientHandshake` in interface `Handshake`
  Throws:
    `IOException`
    `HandshakeException`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads