net.anotheria.net.tcp.server
Class AbstractTCPConnection

java.lang.Object
  extended by net.anotheria.net.shared.server.AbstractConnection
      extended by net.anotheria.net.tcp.server.AbstractTCPConnection
All Implemented Interfaces:
Runnable, IConnection
Direct Known Subclasses:
O2OConnection, ProxyConnection

public abstract class AbstractTCPConnection
extends AbstractConnection
implements Runnable

Base class for TCP connections.

Author:
lrosenberg

Constructor Summary
protected AbstractTCPConnection(Socket aSocket)
          Creates a new AbstractTCPConnection tied to a socket.
 
Method Summary
 void close()
          Closes the connection.
protected  Socket getSocket()
          Returns the underlying socket.
 void open()
          Opens a connection and creates a reader.
protected  void setSocket(Socket socket)
          Sets the socket for this connection.
 
Methods inherited from class net.anotheria.net.shared.server.AbstractConnection
addConnectionListener, removeConnectionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

AbstractTCPConnection

protected AbstractTCPConnection(Socket aSocket)
Creates a new AbstractTCPConnection tied to a socket.

Parameters:
aSocket - the socket to tie the connection to
Method Detail

close

public void close()
Closes the connection.

Specified by:
close in interface IConnection
Overrides:
close in class AbstractConnection

open

public void open()
Opens a connection and creates a reader.

Specified by:
open in interface IConnection
Overrides:
open in class AbstractConnection

getSocket

protected Socket getSocket()
Returns the underlying socket.

Returns:
the socket

setSocket

protected void setSocket(Socket socket)
Sets the socket for this connection.

Parameters:
socket - the socket to set.


Copyright © 2010-2013 anotheria.net. All Rights Reserved.