# SubDataClient (SubServers.Host)

net.ME1312.SubServers.Host.Network

## Class SubDataClient

- java.lang.Object
- - net.ME1312.SubServers.Host.Network.SubDataClient

    public final class SubDataClient
    extends java.lang.Object

SubData Direct Client Class

### Nested Class Summary

Nested Classes
`static class` `SubDataClient.Encryption`

### Constructor Summary

Constructors
Constructor and Description
`SubDataClient(ExHost host, java.lang.String name, java.net.InetAddress address, int port, SubDataClient.Encryption encryption)` SubServers Client Instance

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `broadcastPacket(PacketOut packet)` Broadcast packet to all Clients
`void` `destroy(int reconnect)` Drops All Connections and Stops the SubData Listener
`void` `forwardPacket(PacketOut packet, java.lang.String location)` Forward Packet to Server
`java.net.Socket` `getClient()` Gets the Server Socket
`SubDataClient.Encryption` `getEncryption()` Gets the Connection's Encryption method
`java.lang.String` `getName()` Gets the Assigned Host Name
`static java.util.List<? extends PacketIn>` `getPacket(java.lang.String handle)` Grab PacketIn Instances via handle
`static void` `registerPacket(java.lang.Class<? extends PacketOut> packet, java.lang.String handle)` Register PacketOut to the Network
`static void` `registerPacket(PacketIn packet, java.lang.String handle)` Register PacketIn to the Network
`void` `sendPacket(PacketOut packet)` Send Packet to Client
`static void` `unregisterPacket(java.lang.Class<? extends PacketOut> packet)` Unregister PacketOut to the Network
`static void` `unregisterPacket(PacketIn packet)` Unregister PacketIn from the Network

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

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

### Constructor Detail

#### SubDataClient

    public SubDataClient(ExHost host,
                         java.lang.String name,
                         java.net.InetAddress address,
                         int port,
                         SubDataClient.Encryption encryption)
                  throws java.io.IOException

SubServers Client Instance

Parameters:
  `host` - SubServers.Host
  `name` - Name of Host
  `address` - Address
  `port` - Port
  `encryption` - Encryption Type
Throws:
  `java.io.IOException`

### Method Detail

#### getName

    public java.lang.String getName()

Gets the Assigned Host Name

Returns:
  Host Name

#### getClient

    public java.net.Socket getClient()

Gets the Server Socket

Returns:
  Server Socket

#### getEncryption

    public SubDataClient.Encryption getEncryption()

Gets the Connection's Encryption method

Returns:
  Encryption method

#### registerPacket

    public static void registerPacket(PacketIn packet,
                                      java.lang.String handle)

Register PacketIn to the Network

Parameters:
  `packet` - PacketIn to register
  `handle` - Handle to Bind

#### unregisterPacket

    public static void unregisterPacket(PacketIn packet)

Unregister PacketIn from the Network

Parameters:
  `packet` - PacketIn to unregister

#### registerPacket

    public static void registerPacket(java.lang.Class<? extends PacketOut> packet,
                                      java.lang.String handle)

Register PacketOut to the Network

Parameters:
  `packet` - PacketOut to register
  `handle` - Handle to bind

#### unregisterPacket

    public static void unregisterPacket(java.lang.Class<? extends PacketOut> packet)

Unregister PacketOut to the Network

Parameters:
  `packet` - PacketOut to unregister

#### getPacket

    public static java.util.List<? extends PacketIn> getPacket(java.lang.String handle)

Grab PacketIn Instances via handle

Parameters:
  `handle` - Handle
Returns:
  PacketIn

#### sendPacket

    public void sendPacket(PacketOut packet)

Send Packet to Client

Parameters:
  `packet` - Packet to send

#### forwardPacket

    public void forwardPacket(PacketOut packet,
                              java.lang.String location)

Forward Packet to Server

Parameters:
  `packet` - Packet to send
  `location` - Where to send

#### broadcastPacket

    public void broadcastPacket(PacketOut packet)

Broadcast packet to all Clients

Parameters:
  `packet` - Packet to send

#### destroy

    public void destroy(int reconnect)
                 throws java.io.IOException

Drops All Connections and Stops the SubData Listener

Throws:
  `java.io.IOException`