package org.jboss.pitbull.internal.nio.websocket.impl.oio; import org.jboss.pitbull.internal.nio.websocket.impl.Frame; import java.io.IOException; import java.net.URI; /** * A WebSocket that blocks when you readFrame or writeFrame. Underneath, based on java.io.* a.k.a. Old IO (Oio). * * @author Mike Brock * @version $Revision: 1 $ */ public interface OioWebSocket { /** * A unique ID associated with the socket, which can be used for session association. This ID is generated by the * WebSockets framework as a random hash when the socket is open and has no association with any external API or * the websocket handshake process. * * @return A hex string representing the unique ID of the socket. */ String getSocketID(); public String getVersion(); /** * URI used to connect to this websocket * * @return */ public URI getUri(); /** * Read a single frame from the socket. * * @return * @throws java.io.IOException */ Frame readFrame() throws IOException; /** * Write a frame to the socket. * * @param frame * @throws java.io.IOException */ void writeFrame(Frame frame) throws IOException; /** * Terminates the connection with the client and closes the socket. */ void closeSocket() throws IOException; }