com.aelitis.azureus.core.clientmessageservice.secure.impl
Class SecureMessageServiceClientHelper

java.lang.Object
  extended by com.aelitis.azureus.core.clientmessageservice.secure.impl.SecureMessageServiceClientHelper
All Implemented Interfaces:
ClientMessageService

public class SecureMessageServiceClientHelper
extends Object
implements ClientMessageService


Constructor Summary
protected SecureMessageServiceClientHelper(String server_address, int server_port, int timeout_secs, String msg_type_id, RSAPublicKey public_key)
           
 
Method Summary
 void close()
          Drop and closedown the connection with the server.
static ClientMessageService getServerService(String server_address, int server_port, int timeout_secs, String msg_type_id, RSAPublicKey public_key)
           
 Map receiveMessage()
          Receive the next message from the server.
 void sendMessage(Map plain_payload)
          Send the given message to the server service.
 void setMaximumMessageSize(int max_bytes)
          Override the default max message size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureMessageServiceClientHelper

protected SecureMessageServiceClientHelper(String server_address,
                                           int server_port,
                                           int timeout_secs,
                                           String msg_type_id,
                                           RSAPublicKey public_key)
                                    throws IOException
Throws:
IOException
Method Detail

getServerService

public static ClientMessageService getServerService(String server_address,
                                                    int server_port,
                                                    int timeout_secs,
                                                    String msg_type_id,
                                                    RSAPublicKey public_key)
                                             throws IOException
Throws:
IOException

sendMessage

public void sendMessage(Map plain_payload)
                 throws IOException
Description copied from interface: ClientMessageService
Send the given message to the server service. NOTE: blocking op

Specified by:
sendMessage in interface ClientMessageService
Parameters:
plain_payload - (bencode-able) to send
Throws:
IOException - on error

receiveMessage

public Map receiveMessage()
                   throws IOException
Description copied from interface: ClientMessageService
Receive the next message from the server. NOTE: blocking op

Specified by:
receiveMessage in interface ClientMessageService
Returns:
message received
Throws:
IOException - on error

close

public void close()
Description copied from interface: ClientMessageService
Drop and closedown the connection with the server.

Specified by:
close in interface ClientMessageService

setMaximumMessageSize

public void setMaximumMessageSize(int max_bytes)
Description copied from interface: ClientMessageService
Override the default max message size

Specified by:
setMaximumMessageSize in interface ClientMessageService