├── .gitignore
├── .idea
├── $PRODUCT_WORKSPACE_FILE$
├── .gitignore
├── artifacts
│ └── processing_websockets_jar.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── LICENSE
├── README.md
├── examples
├── websocketClient
│ └── websocketClient.pde
└── websocketServer
│ └── websocketServer.pde
├── library.properties
├── library
├── javax.servlet-api-3.1.0.jar
├── jetty-client-9.3.6.v20151106.jar
├── jetty-http-9.3.6.v20151106.jar
├── jetty-io-9.3.6.v20151106.jar
├── jetty-security-9.3.6.v20151106.jar
├── jetty-server-9.3.6.v20151106.jar
├── jetty-servlet-9.3.6.v20151106.jar
├── jetty-util-9.3.6.v20151106.jar
├── slf4j-api-1.7.13.jar
├── slf4j-simple-1.7.13.jar
├── webSockets.jar
├── websocket-api-9.3.6.v20151106.jar
├── websocket-client-9.3.6.v20151106.jar
├── websocket-common-9.3.6.v20151106.jar
├── websocket-server-9.3.6.v20151106.jar
└── websocket-servlet-9.3.6.v20151106.jar
├── processing_websockets.iml
├── references
├── allclasses-frame.html
├── allclasses-noframe.html
├── constant-values.html
├── deprecated-list.html
├── help-doc.html
├── index-files
│ ├── index-1.html
│ ├── index-10.html
│ ├── index-2.html
│ ├── index-3.html
│ ├── index-4.html
│ ├── index-5.html
│ ├── index-6.html
│ ├── index-7.html
│ ├── index-8.html
│ └── index-9.html
├── index.html
├── overview-tree.html
├── package-list
├── script.js
├── stylesheet.css
└── websockets
│ ├── WebsocketClient.html
│ ├── WebsocketClientEvents.html
│ ├── WebsocketServer.html
│ ├── WebsocketServerController.html
│ ├── WebsocketServerCreator.html
│ ├── WebsocketServerEvents.html
│ ├── class-use
│ ├── WebsocketClient.html
│ ├── WebsocketClientEvents.html
│ ├── WebsocketServer.html
│ ├── WebsocketServerController.html
│ ├── WebsocketServerCreator.html
│ └── WebsocketServerEvents.html
│ ├── package-frame.html
│ ├── package-summary.html
│ ├── package-tree.html
│ └── package-use.html
├── src
└── websockets
│ ├── NoLogging.java
│ ├── WebsocketClient.java
│ ├── WebsocketClientEvents.java
│ ├── WebsocketServer.java
│ ├── WebsocketServerController.java
│ ├── WebsocketServerCreator.java
│ └── WebsocketServerEvents.java
└── webSockets.zip
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | # Created by https://www.gitignore.io/api/intellij
4 | # Edit at https://www.gitignore.io/?templates=intellij
5 |
6 | ### Intellij ###
7 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
8 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
9 |
10 | # User-specific stuff
11 | .idea/**/workspace.xml
12 | .idea/**/tasks.xml
13 | .idea/**/usage.statistics.xml
14 | .idea/**/dictionaries
15 | .idea/**/shelf
16 |
17 | # Generated files
18 | .idea/**/contentModel.xml
19 |
20 | # Sensitive or high-churn files
21 | .idea/**/dataSources/
22 | .idea/**/dataSources.ids
23 | .idea/**/dataSources.local.xml
24 | .idea/**/sqlDataSources.xml
25 | .idea/**/dynamic.xml
26 | .idea/**/uiDesigner.xml
27 | .idea/**/dbnavigator.xml
28 |
29 | # Gradle
30 | .idea/**/gradle.xml
31 | .idea/**/libraries
32 |
33 | # Gradle and Maven with auto-import
34 | # When using Gradle or Maven with auto-import, you should exclude module files,
35 | # since they will be recreated, and may cause churn. Uncomment if using
36 | # auto-import.
37 | # .idea/modules.xml
38 | # .idea/*.iml
39 | # .idea/modules
40 | # *.iml
41 | # *.ipr
42 |
43 | # CMake
44 | cmake-build-*/
45 |
46 | # Mongo Explorer plugin
47 | .idea/**/mongoSettings.xml
48 |
49 | # File-based project format
50 | *.iws
51 |
52 | # IntelliJ
53 | out/
54 |
55 | # mpeltonen/sbt-idea plugin
56 | .idea_modules/
57 |
58 | # JIRA plugin
59 | atlassian-ide-plugin.xml
60 |
61 | # Cursive Clojure plugin
62 | .idea/replstate.xml
63 |
64 | # Crashlytics plugin (for Android Studio and IntelliJ)
65 | com_crashlytics_export_strings.xml
66 | crashlytics.properties
67 | crashlytics-build.properties
68 | fabric.properties
69 |
70 | # Editor-based Rest Client
71 | .idea/httpRequests
72 |
73 | # Android studio 3.1+ serialized cache file
74 | .idea/caches/build_file_checksums.ser
75 |
76 | ### Intellij Patch ###
77 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
78 |
79 | # *.iml
80 | # modules.xml
81 | # .idea/misc.xml
82 | # *.ipr
83 |
84 | # Sonarlint plugin
85 | .idea/**/sonarlint/
86 |
87 | # SonarQube Plugin
88 | .idea/**/sonarIssues.xml
89 |
90 | # Markdown Navigator plugin
91 | .idea/**/markdown-navigator.xml
92 | .idea/**/markdown-navigator/
93 |
94 | # End of https://www.gitignore.io/api/intellij
95 |
--------------------------------------------------------------------------------
/.idea/$PRODUCT_WORKSPACE_FILE$:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 1.8
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /workspace.xml
--------------------------------------------------------------------------------
/.idea/artifacts/processing_websockets_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | $PROJECT_DIR$/out/artifacts/processing_websockets_jar
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Alexandra Institute
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Websockets for Processing
2 |
3 | **Create websocket servers and clients, which makes it possible to communicate with the
4 | outside world including web sites. With this library it is possible to have true two-way
5 | real-time connections with other Processing sketches, web sites, Internet of Things
6 | devices, etc.**
7 |
8 | > 🙋 We are looking for a new maintainer / owner of this repository
9 |
10 | ## Download
11 | The library can be downloaded here:
12 | https://github.com/alexandrainst/processing_websockets/blob/master/webSockets.zip?raw=true
13 |
14 | ## Installation
15 | Unzip and put the extracted webSockets folder into the libraries folder of your Processing
16 | sketches. Reference and examples are included in the webSockets folder.
17 |
18 | ## Examples explained
19 | I have provided two simple examples on using both the client and server part. These can be
20 | found in the examples folder. Below I will go through each example, and elaborate their usage.
21 |
22 | ### Websocket client
23 |
24 | In the following I provide the full example code of creating a websocket client in Processing.
25 | In the below code I draw a new ellipse at a random location (without removing the previous)
26 | each time I get a message from the websocket server, and I send a message to the server every
27 | 5 seconds ("Client message").
28 |
29 | ```java
30 | import websockets.*;
31 |
32 | WebsocketClient wsc;
33 | int now;
34 | boolean newEllipse;
35 |
36 | void setup(){
37 | size(200,200);
38 |
39 | newEllipse=true;
40 |
41 | //Here I initiate the websocket connection by connecting to "ws://localhost:8025/john", which is the uri of the server.
42 | //this refers to the Processing sketch it self (you should always write "this").
43 | wsc= new WebsocketClient(this, "ws://localhost:8025/john");
44 | now=millis();
45 | }
46 |
47 | void draw(){
48 | //Here I draw a new ellipse if newEllipse is true
49 | if(newEllipse){
50 | ellipse(random(width),random(height),10,10);
51 | newEllipse=false;
52 | }
53 |
54 | //Every 5 seconds I send a message to the server through the sendMessage method
55 | if(millis()>now+5000){
56 | wsc.sendMessage("Client message");
57 | now=millis();
58 | }
59 | }
60 |
61 | //This is an event like onMouseClicked. If you chose to use it, it will be executed whenever the server sends a message
62 | void webSocketEvent(String msg){
63 | println(msg);
64 | newEllipse=true;
65 | }
66 | ```
67 |
68 | ### Websocket server
69 |
70 | In the following I provide the full example code of creating a websocket server in Processing.
71 | In the below code I move an ellipse to a random location when I get a message from a client,
72 | and I send a message to ll clients every 5 seconds ("Server message").
73 |
74 | ```java
75 | import websockets.*;
76 |
77 | WebsocketServer ws;
78 | int now;
79 | float x,y;
80 |
81 | void setup(){
82 | size(200,200);
83 |
84 | //Initiates the websocket server, and listens for incoming connections on ws://localhost:8025/john
85 | ws= new WebsocketServer(this,8025,"/john");
86 | now=millis();
87 | x=0;
88 | y=0;
89 | }
90 |
91 | void draw(){
92 | background(0);
93 | ellipse(x,y,10,10);
94 |
95 | //Send message to all clients very 5 seconds
96 | if(millis()>now+5000){
97 | ws.sendMessage("Server message");
98 | now=millis();
99 | }
100 | }
101 |
102 | //This is an event like onMouseClicked. If you chose to use it, it will be executed whenever a client sends a message
103 | void webSocketServerEvent(String msg){
104 | println(msg);
105 | x=random(width);
106 | y=random(height);
107 | }
108 | ```
109 |
110 | ### How to set custom headers on your client
111 |
112 | Construct your `WebsocketClient` with custom headers passing them as a `StringArray`, with `key:value` pairs separated by colons:
113 |
114 | ```java
115 | StringList headers = new StringList();
116 | headers.append("User-Agent:Processing");
117 | wsc=new WebsocketClient(this, "ws://simple-websocket-server-echo.glitch.me/", headers);
118 | ```
119 |
120 |
121 | ### Set message max size
122 |
123 | Call this method before calling the constructor to specify the message max size in bytes
124 |
125 | WebsocketServer.setMaxMessageSize(200000);
126 |
127 | ### Enable logging
128 |
129 | By default logging has been disabled, as it looks like errors in the
130 | Processing IDE's console. Call this method before calling the constructor
131 |
132 | WebsocketServer.enableDebug();
133 |
134 | ### How to be notified of user connections / disconnections
135 |
136 | Implement the following two methods, which will receive the user id hash and
137 | the user IP address.
138 |
139 | ```java
140 | public void webSocketConnectEvent(String uid, String ip) {
141 | println("Someone connected", uid, ip);
142 | }
143 |
144 | public void webSocketDisconnectEvent(String uid, String ip) {
145 | println("Someone disconnected", uid, ip);
146 | }
147 | ```
148 |
149 | ### How to send a message to a specific user
150 |
151 | You need the user ID to send a message to that user only.
152 | You receive that user ID when the user first connects.
153 |
154 | ws.sendMessageTo("message", "userID");
155 |
156 | or
157 |
158 | ws.sendMessageTo(byteArray, "userID");
159 |
160 | ### How to instantiate the WebsocketServer in your own class instead of the PApplet
161 |
162 | Note the extra second argument in the constructor. That's the Object that will implement all the webSocketXXX() methods. Without that second argument it is assumed that the PApplet will implement such methods.
163 |
164 | ```java
165 | public class CaptainSocket {
166 | WebsocketServer ws;
167 | CaptainSocket(PApplet p5) {
168 | ws = new WebsocketServer(p5, this, 8025, "/miau");
169 | }
170 | public void webSocketServerEvent(String msg) {
171 | println(msg);
172 | }
173 | }
174 |
175 | ... in your PApplet ...
176 |
177 | CaptainSocket socket;
178 | void setup() {
179 | socket = new CaptainSocket(this);
180 | }
181 |
182 | ```
183 |
184 | ## Technical development details
185 |
186 | The library has been developed on a Mac with El Capitan, I have used the Eclipse Luna IDE,
187 | and I have only tested on Processing version 3.0.1.
188 |
189 | The library is build with the Jetty websocket implementation, and different Jetty libraries
190 | are therefore needed for running this library. All dependencies are included in the downloadable
191 | zip file. The source code is available through this Github project (open source under MIT
192 | license) as well as included in the zip file below.
193 |
--------------------------------------------------------------------------------
/examples/websocketClient/websocketClient.pde:
--------------------------------------------------------------------------------
1 | import websockets.*;
2 |
3 | WebsocketClient wsc;
4 | int now;
5 | boolean newEllipse;
6 |
7 | void setup(){
8 | size(200,200);
9 |
10 | newEllipse=true;
11 |
12 | wsc= new WebsocketClient(this, "ws://localhost:8025/john");
13 | now=millis();
14 | }
15 |
16 | void draw(){
17 | if(newEllipse){
18 | ellipse(random(width),random(height),10,10);
19 | newEllipse=false;
20 | }
21 |
22 | if(millis()>now+5000){
23 | wsc.sendMessage("Client message");
24 | now=millis();
25 | }
26 | }
27 |
28 | void webSocketEvent(String msg){
29 | println(msg);
30 | newEllipse=true;
31 | }
--------------------------------------------------------------------------------
/examples/websocketServer/websocketServer.pde:
--------------------------------------------------------------------------------
1 | import websockets.*;
2 |
3 | WebsocketServer ws;
4 | int now;
5 | float x,y;
6 |
7 | void setup(){
8 | size(200,200);
9 | ws= new WebsocketServer(this,8025,"/john");
10 | now=millis();
11 | x=0;
12 | y=0;
13 | }
14 |
15 | void draw(){
16 | background(0);
17 | ellipse(x,y,10,10);
18 | if(millis()>now+5000){
19 | ws.sendMessage("Server message");
20 | now=millis();
21 | }
22 | }
23 |
24 | void webSocketServerEvent(String msg){
25 | println(msg);
26 | x=random(width);
27 | y=random(height);
28 | }
--------------------------------------------------------------------------------
/library.properties:
--------------------------------------------------------------------------------
1 | # UTF-8 supported.
2 |
3 | # The name of your library as you want it formatted.
4 | name = Websockets
5 |
6 | # List of authors. Links can be provided using the syntax [author name](url).
7 | authors = Lasse Steenbock Vestergaard
8 |
9 | # A web page for your library, NOT a direct link to where to download it.
10 | url = https://github.com/alexandrainst/processing_websockets
11 |
12 | # The category (or categories) of your library, must be from the following list:
13 | # "3D" "Animation" "Compilations" "Data"
14 | # "Fabrication" "Geometry" "GUI" "Hardware"
15 | # "I/O" "Language" "Math" "Simulation"
16 | # "Sound" "Utilities" "Typography" "Video & Vision"
17 | #
18 | # If a value other than those listed is used, your library will listed as
19 | # "Other". Many categories must be comma-separated.
20 | categories = Data, I/O
21 |
22 | # A short sentence (or fragment) to summarize the library's function. This will
23 | # be shown from inside the PDE when the library is being installed. Avoid
24 | # repeating the name of your library here. Also, avoid saying anything redundant
25 | # like mentioning that it's a library. This should start with a capitalized
26 | # letter, and end with a period.
27 | sentence = Create websocket servers and clients, which makes it possible to communicate with the outside world including web sites.
28 |
29 | # Additional information suitable for the Processing website. The value of
30 | # 'sentence' always will be prepended, so you should start by writing the
31 | # second sentence here. If your library only works on certain operating systems,
32 | # mention it here.
33 | paragraph = With this library it's possible to have true two way real-time connections with other Processing sketches, web sites, Internet of Things devises etc. For a concrete use case please take a look at the examples folder.
34 |
35 | # Links in the 'sentence' and 'paragraph' attributes can be inserted using the
36 | # same syntax as for authors.
37 | # That is, [here is a link to Processing](http://processing.org/)
38 |
39 | # A version number that increments once with each release. This is used to
40 | # compare different versions of the same library, and check if an update is
41 | # available. You should think of it as a counter, counting the total number of
42 | # releases you've had.
43 | version = 1 # This must be parsable as an int
44 |
45 | # The version as the user will see it. If blank, the version attribute will be
46 | # used here. This should be a single word, with no spaces.
47 | prettyVersion = 0.1b # This is treated as a String
48 |
49 | # The min and max revision of Processing compatible with your library.
50 | # Note that these fields use the revision and not the version of Processing,
51 | # parsable as an int. For example, the revision number for 2.2.1 is 227.
52 | # You can find the revision numbers in the change log:
53 | # https://raw.githubusercontent.com/processing/processing/master/build/shared/revisions.txt
54 | # Only use maxRevision (or minRevision), when your library is known to
55 | # break in a later (or earlier) release. Otherwise, use the default value 0.
56 | minRevision = 0
57 | maxRevision = 0
--------------------------------------------------------------------------------
/library/javax.servlet-api-3.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/javax.servlet-api-3.1.0.jar
--------------------------------------------------------------------------------
/library/jetty-client-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-client-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/jetty-http-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-http-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/jetty-io-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-io-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/jetty-security-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-security-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/jetty-server-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-server-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/jetty-servlet-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-servlet-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/jetty-util-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/jetty-util-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/slf4j-api-1.7.13.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/slf4j-api-1.7.13.jar
--------------------------------------------------------------------------------
/library/slf4j-simple-1.7.13.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/slf4j-simple-1.7.13.jar
--------------------------------------------------------------------------------
/library/webSockets.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/webSockets.jar
--------------------------------------------------------------------------------
/library/websocket-api-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/websocket-api-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/websocket-client-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/websocket-client-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/websocket-common-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/websocket-common-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/websocket-server-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/websocket-server-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/library/websocket-servlet-9.3.6.v20151106.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexandrainst/processing_websockets/ceec7cf5cd3e07b8a3fb5552f291e363ae10e27c/library/websocket-servlet-9.3.6.v20151106.jar
--------------------------------------------------------------------------------
/processing_websockets.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/references/allclasses-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
74 |
75 |
76 |
77 |
78 |
Package
79 |
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
80 |
81 |
Interfaces (italic)
82 |
Classes
83 |
Enums
84 |
Exceptions
85 |
Errors
86 |
Annotation Types
87 |
88 |
89 |
90 |
Class/Interface
91 |
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
92 |
93 |
Class inheritance diagram
94 |
Direct Subclasses
95 |
All Known Subinterfaces
96 |
All Known Implementing Classes
97 |
Class/interface declaration
98 |
Class/interface description
99 |
100 |
101 |
Nested Class Summary
102 |
Field Summary
103 |
Constructor Summary
104 |
Method Summary
105 |
106 |
107 |
Field Detail
108 |
Constructor Detail
109 |
Method Detail
110 |
111 |
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
112 |
113 |
114 |
Annotation Type
115 |
Each annotation type has its own separate page with the following sections:
116 |
117 |
Annotation Type declaration
118 |
Annotation Type description
119 |
Required Element Summary
120 |
Optional Element Summary
121 |
Element Detail
122 |
123 |
124 |
125 |
Enum
126 |
Each enum has its own separate page with the following sections:
127 |
128 |
Enum declaration
129 |
Enum description
130 |
Enum Constant Summary
131 |
Enum Constant Detail
132 |
133 |
134 |
135 |
Use
136 |
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
137 |
138 |
139 |
Tree (Class Hierarchy)
140 |
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
141 |
142 |
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
143 |
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
144 |
145 |
146 |
147 |
Deprecated API
148 |
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
149 |
150 |
151 |
Index
152 |
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
153 |
154 |
155 |
Prev/Next
156 |
These links take you to the next or previous class, interface, package, or related page.
157 |
158 |
159 |
Frames/No Frames
160 |
These links show and hide the HTML frames. All pages are available with or without frames.
161 |
162 |
163 |
All Classes
164 |
The All Classes link shows all classes and interfaces except non-static nested types.
165 |
166 |
167 |
Serialized Form
168 |
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
public class WebsocketClient
112 | extends java.lang.Object
113 |
114 |
Author:
115 |
Lasse Steenbock Vestergaard
116 |
117 | Class for creating websocket client connections to any websocket server. Sub-protocols have not yet been implemented, and it's therefore only possible to connect to regular websocket servers.
This method is used for sending messages to all connected clients. This method will be updated with the possibility for sending messages to specific clients!
222 |
223 |
Parameters:
224 |
message - The message you want to send to all clients