Class WebsocketConnectionClient2
- java.lang.Object
- 
- jadex.platform.service.message.websockettransport.AWebsocketConnection
- 
- jadex.platform.service.message.websockettransport.WebsocketConnectionClient2
 
 
- 
- All Implemented Interfaces:
- IWebSocketConnection
 
 public class WebsocketConnectionClient2 extends AWebsocketConnection 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringaddressThe connection address.protected org.java_websocket.client.WebSocketClientwsclientThe websocket client.- 
Fields inherited from class jadex.platform.service.message.websockettransport.AWebsocketConnectionbytesreceived, handler, hasheader, header, maxmsgsize, NULL_MSG_COMMAND, pojoagent
 
- 
 - 
Constructor SummaryConstructors Constructor Description WebsocketConnectionClient2(java.lang.String address, IComponentIdentifier target, ITransportHandler<IWebSocketConnection> handler)Creates the connection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the connection (ignored if already closed).IFuture<IWebSocketConnection>connect()Establishes the connection.voidforceClose()Forcibly closes the connection (ignored if already closed).protected IFuture<java.lang.Void>sendAsFrames(byte[] data)Fragment and send data as websocket frames.IFuture<java.lang.Integer>sendMessage(byte[] header, byte[] body)Send bytes using the connection.- 
Methods inherited from class jadex.platform.service.message.websockettransport.AWebsocketConnectionhandleMessagePayload
 
- 
 
- 
- 
- 
Constructor Detail- 
WebsocketConnectionClient2public WebsocketConnectionClient2(java.lang.String address, IComponentIdentifier target, ITransportHandler<IWebSocketConnection> handler)Creates the connection.- Parameters:
- address- Target address.
- target- Target platform.
 
 
- 
 - 
Method Detail- 
connectpublic IFuture<IWebSocketConnection> connect() Establishes the connection.- Returns:
- This object when done, exception on connection error.
 
 - 
sendMessagepublic IFuture<java.lang.Integer> sendMessage(byte[] header, byte[] body) Description copied from interface:IWebSocketConnectionSend bytes using the connection.- Parameters:
- header- The message header.
- body- The message body.
- Returns:
- A future indicating success.
 
 - 
closepublic void close() Description copied from interface:IWebSocketConnectionCloses the connection (ignored if already closed).
 - 
forceClosepublic void forceClose() Description copied from interface:IWebSocketConnectionForcibly closes the connection (ignored if already closed).
 - 
sendAsFramesprotected IFuture<java.lang.Void> sendAsFrames(byte[] data) Fragment and send data as websocket frames.- Parameters:
- data- The data.
- fut- The future.
 
 
- 
 
-