com.epam.common.transport.client.tcp
Class TCPTransport

java.lang.Object
  extended by com.epam.common.transport.SocketTransport
      extended by com.epam.common.transport.client.tcp.TCPTransport
All Implemented Interfaces:
ClientTransport, Transport
Direct Known Subclasses:
SSLTCPTransport

public class TCPTransport
extends SocketTransport
implements ClientTransport

TCP socket transport implementation.


Field Summary
 
Fields inherited from class com.epam.common.transport.SocketTransport
is, os, socket
 
Constructor Summary
TCPTransport()
          Creates transport.
TCPTransport(String host, int port)
          Creates transport.
TCPTransport(String host, int port, boolean enableTcpNoDelay)
          Creates transport.
 
Method Summary
 void close()
          Close the transport.
 boolean isOpen()
          Returns true if, transport is open.
 void open()
          Open the transport.
 void setAddress(String host)
          Setter for address.
 void setPort(int port)
          Setter for port.
 void setSocketFactory(SocketFactory socketFactory)
          Setter for socket factory transport.
 
Methods inherited from class com.epam.common.transport.SocketTransport
getAddress, getInputStream, getOutputStream, getPort, isBlockingSocket, read, read, read, read, waitUntilReadyToWrite, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.epam.common.transport.client.ClientTransport
read, read, write, write
 
Methods inherited from interface com.epam.common.transport.Transport
getAddress, getPort, isBlockingSocket, read, read, waitUntilReadyToWrite, write, write
 

Constructor Detail

TCPTransport

public TCPTransport()
Creates transport.


TCPTransport

public TCPTransport(String host,
                    int port)
Creates transport.

Parameters:
host - the transport host
port - the transport port

TCPTransport

public TCPTransport(String host,
                    int port,
                    boolean enableTcpNoDelay)
Creates transport.

Parameters:
host - the transport host
port - the transpot port
enableTcpNoDelay - enable/disable nagle sockets algorithm
Method Detail

setSocketFactory

public void setSocketFactory(SocketFactory socketFactory)
Setter for socket factory transport.

Specified by:
setSocketFactory in interface ClientTransport
Parameters:
socketFactory - the socket factory

setAddress

public void setAddress(String host)
Description copied from interface: ClientTransport
Setter for address.

Specified by:
setAddress in interface ClientTransport
See Also:
ClientTransport.setAddress(String)

setPort

public void setPort(int port)
Description copied from interface: ClientTransport
Setter for port.

Specified by:
setPort in interface ClientTransport
See Also:
ClientTransport.setPort(int)

open

public void open()
          throws IOException
Description copied from interface: Transport
Open the transport.

Specified by:
open in interface Transport
Specified by:
open in class SocketTransport
Throws:
IOException - - throws if error occurred
See Also:
Transport.open()

close

public void close()
           throws IOException
Description copied from interface: Transport
Close the transport.

Specified by:
close in interface Transport
Overrides:
close in class SocketTransport
Throws:
IOException - - throws if error occurred
See Also:
Transport.close()

isOpen

public boolean isOpen()
Description copied from interface: Transport
Returns true if, transport is open.

Specified by:
isOpen in interface Transport
Overrides:
isOpen in class SocketTransport
See Also:
Transport.isOpen()


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.