vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

WebSocket.send - multiple declarations

Function WebSocket.send

Sends a text message.

void send (
  scope const(char)[] data
) @safe;

On the JavaScript side, the text will be available as message.data (type string).

Throws

A WebSocketException is thrown if the connection gets closed before or during the transfer of the message.

Function WebSocket.send

Sends a binary message.

void send (
  const(ubyte[]) data
) @safe;

On the JavaScript side, the text will be available as message.data (type Blob).

Throws

A WebSocketException is thrown if the connection gets closed before or during the transfer of the message.

Function WebSocket.send

Sends a message using an output stream.

void send (
  scope @safe void delegate(scope OutgoingWebSocketMessage) sender,
  vibe.http.websockets.FrameOpcode frameOpcode
) @safe;

Throws

A WebSocketException is thrown if the connection gets closed before or during the transfer of the message.

Function WebSocket.send

Compatibility overload - will be removed soon.

deprecated void send (
  scope @safe void delegate(scope OutgoingWebSocketMessage) sender
) @safe;
Authors

Jan Krüger

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.