Пример #1
0
 /**
  * Send Binary data (plain bytes) to the other end.
  *
  * @throws IllegalArgumentException
  * @throws NotYetConnectedException
  */
 @Override
 public void send(ByteBuffer bytes)
     throws IllegalArgumentException, WebsocketNotConnectedException {
   if (bytes == null)
     throw new IllegalArgumentException("Cannot send 'null' data to a WebSocketImpl.");
   send(draft.createFrames(bytes, role == Role.CLIENT));
 }
Пример #2
0
 @Override
 public void send(byte[] bytes) throws IllegalArgumentException, WebsocketNotConnectedException {
   send(ByteBuffer.wrap(bytes));
 }
Пример #3
0
 /**
  * Send Text data to the other end.
  *
  * @throws IllegalArgumentException
  * @throws NotYetConnectedException
  */
 @Override
 public void send(String text) throws WebsocketNotConnectedException {
   if (text == null)
     throw new IllegalArgumentException("Cannot send 'null' data to a WebSocketImpl.");
   send(draft.createFrames(text, role == Role.CLIENT));
 }