API Reference 0.7.1stomp_impl_pluginStompConnector

StompConnector abstract class

A STOMP connector for binding with different networking, such as WebSocket and Socket.

abstract class StompConnector {
 /** Closes the connector.
  */
 Future close();

 /** Write an array of bytes or a [String].
  *
  * *Implementation Notes*
  *
  * If both [bytes] and [string] are specified, they must be
  * equivalent and the implementation can pick up any one that
  * is easier to handle.
  *
  * Otherwise, this method shall pick the non-null one.
  */
 void write(String string, [List<int> bytes]);
 ///Write a stream
 Future writeStream(Stream<List<int>> stream);
 ///Write the NULL octet to indicate the end of a frame.
 void writeEof();
 ///Write the end of line (LF)
 void writeLF();

 /** Called when data in bytes format is received.
  * The implementation can assume it is never null.
  *
  * Note: the implementation shall invoke [onBytes] or [onString],
  * but not both.
  */
 BytesCallback onBytes;
 /** Called when data in String format is received.
  * The implementation can assume it is never null.
  *
  * Note: the implementation shall invoke [onBytes] or [onString],
  * but not both.
  */
 StringCallback onString;
 /** Called when there is an error.
  * The implementation can assume it is never null.
  */
 ErrorCallback onError;
 /** Called when the connection is closed.
  * The implementation can assume it is never null.
  */
 CloseCallback onClose;
}

Subclasses

BytesStompConnector, StringStompConnector

Properties

BytesCallback onBytes #

Called when data in bytes format is received. The implementation can assume it is never null.

Note: the implementation shall invoke onBytes or onString, but not both.

BytesCallback onBytes

CloseCallback onClose #

Called when the connection is closed. The implementation can assume it is never null.

CloseCallback onClose

ErrorCallback onError #

Called when there is an error. The implementation can assume it is never null.

ErrorCallback onError

StringCallback onString #

Called when data in String format is received. The implementation can assume it is never null.

Note: the implementation shall invoke onBytes or onString, but not both.

StringCallback onString

Methods

abstract Future close() #

Closes the connector.

abstract void write(String string, [List<int> bytes]) #

Write an array of bytes or a String.

Implementation Notes

If both bytes and string are specified, they must be equivalent and the implementation can pick up any one that is easier to handle.

Otherwise, this method shall pick the non-null one.

abstract void writeEof() #

Write the NULL octet to indicate the end of a frame.

abstract void writeLF() #

Write the end of line (LF)

abstract Future writeStream(Stream<List<int>> stream) #

Write a stream