fm.liveswitch.TcpSocket Class Reference

Classes

class  DefaultHostnameVerifier
 
class  DistinguishedNameParser
 

Public Member Functions

boolean getServer ()
 Gets a value indicating whether the socket can accept incoming connections. More...
 
boolean getSecure ()
 Gets a value indicating whether the socket is secure. More...
 
boolean getIPv6 ()
 Gets a value indicating whether the socket supports IPv6. More...
 
 TcpSocket (boolean server, boolean ipv6, boolean secure)
 
 TcpSocket (Socket socket, boolean server, boolean secure)
 
boolean getIsClosed ()
 Gets a value indicating whether this instance is closed. More...
 
String getLocalIPAddress ()
 Gets the local IP address. More...
 
int getLocalPort ()
 Gets the local port. More...
 
String getRemoteIPAddress ()
 Gets the remote IP address. More...
 
int getRemotePort ()
 Gets the remote port. More...
 
String getRemoteHostname ()
 Gets the remote hostname. More...
 
boolean bind (String ipAddress, int port, BooleanHolder addressInUse)
 
void acceptAsync (final IAction0 onSuccess, final IAction1< Exception > onFailure, final IAction1< StreamSocket > onSocket)
 
void connectAsync (final String hostname, final String ipAddress, final int port, int timeout, final IAction0 onSuccess, final IAction2< Exception, Boolean > onFailure)
 
boolean send (DataBuffer buffer)
 
void sendAsync (final DataBuffer buffer, int timeout, final IAction0 onSuccess, final IAction2< Exception, Boolean > onFailure)
 
void receiveAsync (int timeout)
 Receives data asynchronously. More...
 
void close ()
 Closes the socket. More...
 
- Public Member Functions inherited from fm.liveswitch.StreamSocket
abstract void acceptAsync (fm.liveswitch.IAction0 onSuccess, fm.liveswitch.IAction1< java.lang.Exception > onFailure, fm.liveswitch.IAction1< fm.liveswitch.StreamSocket > onSocket)
 Accepts a new socket asynchronously. More...
 
abstract void connectAsync (String hostname, String ipAddress, int port, int timeout, fm.liveswitch.IAction0 onSuccess, fm.liveswitch.IAction2< java.lang.Exception, Boolean > onFailure)
 Connects the socket asynchronously. More...
 
fm.liveswitch.IAction2< java.lang.Exception, Boolean > getOnReceiveFailure ()
 Gets a callback invoked on failed read from TCP stream. More...
 
fm.liveswitch.IAction1< fm.liveswitch.DataBuffergetOnReceiveSuccess ()
 Gets a callback invoked on successful read from TCP stream. More...
 
abstract boolean send (fm.liveswitch.DataBuffer buffer)
 Sends data synchronously. More...
 
abstract void sendAsync (fm.liveswitch.DataBuffer buffer, int timeout, fm.liveswitch.IAction0 onSuccess, fm.liveswitch.IAction2< java.lang.Exception, Boolean > onFailure)
 Sends data asynchronously. More...
 
void setOnReceiveFailure (fm.liveswitch.IAction2< java.lang.Exception, Boolean > value)
 Sets a callback invoked on failed read from TCP stream. More...
 
void setOnReceiveSuccess (fm.liveswitch.IAction1< fm.liveswitch.DataBuffer > value)
 Sets a callback invoked on successful read from TCP stream. More...
 
- Public Member Functions inherited from fm.liveswitch.ManagedSocket
abstract boolean bind (String ipAddress, int port, fm.liveswitch.BooleanHolder addressInUse)
 Binds the socket to a local endpoint. More...
 
long getAdapterSpeed ()
 Gets the adapter speed. More...
 
String[] getPublicIPAddresses ()
 Gets the public IP addresses, if known. More...
 
void setAdapterSpeed (long value)
 Sets the adapter speed. More...
 
void setPublicIPAddresses (String[] value)
 Sets the public IP addresses, if known. More...
 

Static Public Member Functions

static TcpSocketCipherSuites getCipherSuites ()
 
static void setCipherSuites (TcpSocketCipherSuites cipherSuites)
 
static boolean getAttemptNoDelay ()
 Get the Socket NoDelay property. More...
 
static void setAttemptNoDelay (boolean noDelay)
 Set the Socket NoDelay property to attempt to disable Nagling. More...
 
static boolean getAttemptDscp ()
 Determine whether sockets will attempt to use DSCP. More...
 
static void setAttemptDscp (boolean dscp)
 Set whether sockets will attempt to use DSCP. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fm.liveswitch.StreamSocket
void raiseAcceptFailure (fm.liveswitch.IAction1< java.lang.Exception > callback, java.lang.Exception exception)
 Invokes the accept failure callback. More...
 
void raiseAcceptSocket (fm.liveswitch.IAction1< fm.liveswitch.StreamSocket > callback, fm.liveswitch.StreamSocket socket)
 Invokes the accept success callback. More...
 
void raiseAcceptSuccess (fm.liveswitch.IAction0 callback)
 Invokes the accept success callback. More...
 
void raiseConnectFailure (fm.liveswitch.IAction2< java.lang.Exception, Boolean > callback, java.lang.Exception exception, boolean timedOut)
 Invokes the connect failure callback. More...
 
void raiseConnectSuccess (fm.liveswitch.IAction0 callback)
 Invokes the connect success callback. More...
 
void raiseReceiveFailure (fm.liveswitch.IAction2< java.lang.Exception, Boolean > callback, java.lang.Exception exception, boolean timedOut)
 Invokes the receive failure callback. More...
 
void raiseReceiveSuccess (fm.liveswitch.IAction1< fm.liveswitch.DataBuffer > callback, fm.liveswitch.DataBuffer buffer)
 Invokes the receive success callback. More...
 
void raiseSendFailure (fm.liveswitch.IAction2< java.lang.Exception, Boolean > callback, java.lang.Exception exception, boolean timedOut)
 Invokes the send failure callback. More...
 
void raiseSendSuccess (fm.liveswitch.IAction0 callback)
 Invokes the send success callback. More...
 
 StreamSocket ()
 
- Protected Member Functions inherited from fm.liveswitch.ManagedSocket
 ManagedSocket ()
 

Constructor & Destructor Documentation

◆ TcpSocket() [1/2]

fm.liveswitch.TcpSocket.TcpSocket ( boolean  server,
boolean  ipv6,
boolean  secure 
)

◆ TcpSocket() [2/2]

fm.liveswitch.TcpSocket.TcpSocket ( Socket  socket,
boolean  server,
boolean  secure 
)

Member Function Documentation

◆ acceptAsync()

void fm.liveswitch.TcpSocket.acceptAsync ( final IAction0  onSuccess,
final IAction1< Exception >  onFailure,
final IAction1< StreamSocket onSocket 
)

◆ bind()

boolean fm.liveswitch.TcpSocket.bind ( String  ipAddress,
int  port,
BooleanHolder  addressInUse 
)

◆ close()

void fm.liveswitch.TcpSocket.close ( )

Closes the socket.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ connectAsync()

void fm.liveswitch.TcpSocket.connectAsync ( final String  hostname,
final String  ipAddress,
final int  port,
int  timeout,
final IAction0  onSuccess,
final IAction2< Exception, Boolean >  onFailure 
)

◆ getAttemptDscp()

static boolean fm.liveswitch.TcpSocket.getAttemptDscp ( )
static

Determine whether sockets will attempt to use DSCP.

Default is false. You must "opt-in".

◆ getAttemptNoDelay()

static boolean fm.liveswitch.TcpSocket.getAttemptNoDelay ( )
static

Get the Socket NoDelay property.

Default is false. You must "opt-in".

◆ getCipherSuites()

static TcpSocketCipherSuites fm.liveswitch.TcpSocket.getCipherSuites ( )
static

◆ getIPv6()

boolean fm.liveswitch.TcpSocket.getIPv6 ( )

Gets a value indicating whether the socket supports IPv6.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getIsClosed()

boolean fm.liveswitch.TcpSocket.getIsClosed ( )

Gets a value indicating whether this instance is closed.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getLocalIPAddress()

String fm.liveswitch.TcpSocket.getLocalIPAddress ( )

Gets the local IP address.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getLocalPort()

int fm.liveswitch.TcpSocket.getLocalPort ( )

Gets the local port.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getRemoteHostname()

String fm.liveswitch.TcpSocket.getRemoteHostname ( )

Gets the remote hostname.

Reimplemented from fm.liveswitch.StreamSocket.

◆ getRemoteIPAddress()

String fm.liveswitch.TcpSocket.getRemoteIPAddress ( )

Gets the remote IP address.

Reimplemented from fm.liveswitch.StreamSocket.

◆ getRemotePort()

int fm.liveswitch.TcpSocket.getRemotePort ( )

Gets the remote port.

Reimplemented from fm.liveswitch.StreamSocket.

◆ getSecure()

boolean fm.liveswitch.TcpSocket.getSecure ( )

Gets a value indicating whether the socket is secure.

Reimplemented from fm.liveswitch.StreamSocket.

◆ getServer()

boolean fm.liveswitch.TcpSocket.getServer ( )

Gets a value indicating whether the socket can accept incoming connections.

Reimplemented from fm.liveswitch.StreamSocket.

◆ receiveAsync()

void fm.liveswitch.TcpSocket.receiveAsync ( int  timeout)

Receives data asynchronously.

Parameters
timeoutThe timeout (in ms).

Reimplemented from fm.liveswitch.StreamSocket.

◆ send()

boolean fm.liveswitch.TcpSocket.send ( DataBuffer  buffer)

◆ sendAsync()

void fm.liveswitch.TcpSocket.sendAsync ( final DataBuffer  buffer,
int  timeout,
final IAction0  onSuccess,
final IAction2< Exception, Boolean >  onFailure 
)

◆ setAttemptDscp()

static void fm.liveswitch.TcpSocket.setAttemptDscp ( boolean  dscp)
static

Set whether sockets will attempt to use DSCP.

Default is false. You must "opt-in".

◆ setAttemptNoDelay()

static void fm.liveswitch.TcpSocket.setAttemptNoDelay ( boolean  noDelay)
static

Set the Socket NoDelay property to attempt to disable Nagling.

Default is false. You must "opt-in".

◆ setCipherSuites()

static void fm.liveswitch.TcpSocket.setCipherSuites ( TcpSocketCipherSuites  cipherSuites)
static