com.glines.socketio.client.jre
Class SocketIOConnectionImpl

java.lang.Object
  extended by com.glines.socketio.client.jre.SocketIOConnectionImpl
All Implemented Interfaces:
SocketIOConnection

public class SocketIOConnectionImpl
extends Object
implements SocketIOConnection


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.glines.socketio.client.common.SocketIOConnection
SocketIOConnection.Factory, SocketIOConnection.SocketIOConnectionListener
 
Constructor Summary
SocketIOConnectionImpl(SocketIOConnection.SocketIOConnectionListener listener, String host, short port)
           
 
Method Summary
 void close()
          Initiate an orderly close of the connection.
 void connect()
          Initiate a connection attempt.
 void disconnect()
          Forcefully disconnect the connection, discarding any unsent messages.
 ConnectionState getConnectionState()
          Return the current socket connection state.
 void sendMessage(int messageType, String message)
          Send a message.
 void sendMessage(String message)
          Send a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketIOConnectionImpl

public SocketIOConnectionImpl(SocketIOConnection.SocketIOConnectionListener listener,
                              String host,
                              short port)
Method Detail

connect

public void connect()
Description copied from interface: SocketIOConnection
Initiate a connection attempt. If the connection succeeds, then the onConnect will be called. If the connection attempt fails, then onDisonnect will be called.

Specified by:
connect in interface SocketIOConnection

close

public void close()
Description copied from interface: SocketIOConnection
Initiate an orderly close of the connection.

Specified by:
close in interface SocketIOConnection

disconnect

public void disconnect()
Description copied from interface: SocketIOConnection
Forcefully disconnect the connection, discarding any unsent messages. This does nothing if the connection is already CLOSED. This will abort an orderly close if one was initiated.

Specified by:
disconnect in interface SocketIOConnection

getConnectionState

public ConnectionState getConnectionState()
Description copied from interface: SocketIOConnection
Return the current socket connection state.

Specified by:
getConnectionState in interface SocketIOConnection
Returns:

sendMessage

public void sendMessage(String message)
                 throws SocketIOException
Description copied from interface: SocketIOConnection
Send a message.

Specified by:
sendMessage in interface SocketIOConnection
Throws:
SocketIOException

sendMessage

public void sendMessage(int messageType,
                        String message)
                 throws SocketIOException
Description copied from interface: SocketIOConnection
Send a message. With a default priority of 0.

Specified by:
sendMessage in interface SocketIOConnection
Throws:
SocketIOException


Copyright © 2010-2011. All Rights Reserved.