public class WebSocketServerHelper extends VertxHelperBase
WebSocketHelper
VertxHelperBase.AccessorVerticle
HelperBase.DATA_TYPE
_verticle, _vertx
_actor, _currentObj
Modifier and Type | Method and Description |
---|---|
void |
addResource(java.lang.String path,
java.lang.Object resource,
java.lang.String contentType)
Add a resource to be served by the server.
|
void |
closeServer()
Close the web socket server.
|
static WebSocketServerHelper |
createServer(java.lang.Object actor,
jdk.nashorn.api.scripting.ScriptObjectMirror currentObj,
java.lang.String hostInterface,
boolean sslTls,
java.lang.String pfxKeyCertPassword,
java.lang.String pfxKeyCertPath,
int port,
java.lang.String receiveType,
java.lang.String sendType)
Create a WebSocketServerHelper instance to help a JavaScript Server instance.
|
void |
setResponse(java.lang.String response)
Set the response.
|
void |
startServer()
Create and start the server and beginning listening for
connections.
|
_issueOrDeferResponse, _processPendingJob, _setBusy, closeVertx, getHelper, getImageTypes, reset, submit, supportedReceiveTypes, supportedSendTypes, undeploy
_appendNumericToBuffer, _appendToBuffer, _error, _error, _error, _error, _extractFromBuffer, _issueResponse, _removeDuplicates, _sizeOfType, _toJavaBytes, _toJSArray, getHelping
public void addResource(java.lang.String path, java.lang.Object resource, java.lang.String contentType)
path
- The path to the resource.resource
- The resource to serve upon a request for this path.contentType
- The content type.public void closeServer()
public static WebSocketServerHelper createServer(java.lang.Object actor, jdk.nashorn.api.scripting.ScriptObjectMirror currentObj, java.lang.String hostInterface, boolean sslTls, java.lang.String pfxKeyCertPassword, java.lang.String pfxKeyCertPath, int port, java.lang.String receiveType, java.lang.String sendType)
actor
- The actor associated with this helper.currentObj
- The JavaScript Server instance for which this is a helper.hostInterface
- The host interface to use, in case there the host has more
than one interface (e.g. Ethernet and WiFi). This is IP address or name, and if
the argument is null, then "localhost" will be used.sslTls
- Whether SSL/TLS is enabled. This defaults to false.port
- The port number that the server will use.pfxKeyCertPassword
- The password to open the file specified in pfxKeyCertPath.pfxKeyCertPath
- The path of the file that stores the private key and certificate in PFX (PKCS#12) format for the server.receiveType
- The type to assume for incoming messages.sendType
- The type for outgoing messages.public void setResponse(java.lang.String response)
response
- The response.public void startServer()