org.apache.wicket.protocol.ws.api
Interface IWebSocketConnection


public interface IWebSocketConnection

Common interface for native WebSocket connections

Since:
6.0

Method Summary
 void close(int code, String reason)
          Closes the underlying web socket connection
 boolean isOpen()
           
 IWebSocketConnection sendMessage(byte[] message, int offset, int length)
          Sends a binary message to the client.
 IWebSocketConnection sendMessage(String message)
          Sends a text message to the client.
 

Method Detail

isOpen

boolean isOpen()
Returns:
true when the underlying native web socket connection is still open.

close

void close(int code,
           String reason)
Closes the underlying web socket connection

Parameters:
code - the status code
reason - the reason to close the connection

sendMessage

IWebSocketConnection sendMessage(String message)
                                 throws IOException
Sends a text message to the client.

Parameters:
message - the text message
Returns:
this object, for chaining methods
Throws:
IOException - when an IO error occurs during the write to the client

sendMessage

IWebSocketConnection sendMessage(byte[] message,
                                 int offset,
                                 int length)
                                 throws IOException
Sends a binary message to the client.

Parameters:
message - the binary message
offset - the offset to read from
length - how much data to read
Returns:
this object, for chaining methods
Throws:
IOException - when an IO error occurs during the write to the client


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.