Class WebSocket
Represents a single WebSocket connection.
Inherits from
-
Object
(base class)
Constructors
Name | Description |
---|---|
this
|
Properties
Name | Type | Description |
---|---|---|
connected
[get]
|
bool |
Determines if the WebSocket connection is still alive and ready for sending.
|
dataAvailableForRead
[get]
|
bool |
Checks if data is readily available for read. |
request
[get]
|
const(HTTPServerRequest) |
The HTTP request that established the web socket connection.
|
Methods
Name | Description |
---|---|
close
|
Actively closes the connection. |
receive
|
Receives a new message using an InputStream. |
receiveBinary
|
Receives a new message and returns its contents as a newly allocated data array. |
receiveText
|
Receives a new message and returns its contents as a newly allocated data array. |
send
|
Sends a text message. |
send
|
Sends a binary message. |
send
|
Sends a message using an output stream. |
waitForData
|
Waits until either a message arrives or until the connection is closed. |
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.