1- Java SE/Android WebSocket client and server package, MIT (c) 2020-2025 miktim@mail.ru
1+ Java SE/Android WebSocket client and server package, MIT (c) 2020-2026 miktim@mail.ru
22
33Release notes:
44 - RFC 6455 compliant package ( https://datatracker.ietf.org/doc/html/rfc6455/ );
@@ -31,13 +31,13 @@ Overview:
3131 The creator of WebSocket servers and client-side connections.
3232
3333 Constant:
34- static final String VERSION = "5.0.5 ";
34+ static final String VERSION = "5.0.6 ";
3535
3636 Constructors:
3737 WebSocket();
3838 - creates WebSocket instance
3939 WebSocket(InetAddress intfAddr) throws SocketException;
40- - creates WebSocket instance on interface;
40+ - creates WebSocket instance on specified interface;
4141 - throws WsError when interface does not exists
4242
4343
@@ -66,9 +66,8 @@ Overview:
6666 wsp: the server-side connections creation and execution parameters;
6767 - throws WsError on IOException, GeneralSecurityException, NullPointerException
6868
69-
7069 WsServer startServer(int port, WsConnection.Handler handler)
71- - creates and starts insecure connections server;
70+ - creates and starts insecure connections server with default parameters ;
7271 - see above.
7372
7473 WsServer startSecureServer(int port, WsConnection.Handler handler, WsParameters wsp)
@@ -80,7 +79,7 @@ Overview:
8079 - see above.
8180
8281 NOTE:
83- if you need to handle server events, use WsServer.Handler wich extends
82+ if you need to handle server events, use WsServer.Handler wich inherits
8483 WsConnection.Handler (see below).
8584
8685 WsConnection connect(String uri, WsConnection.Handler handler, WsParameters wsp);
@@ -166,6 +165,7 @@ Overview:
166165
167166 void close();
168167 - closes connection with status code 1000 (NORMAL_CLOSURE)
168+ and empty reason
169169 void close(String reason);
170170 - closes connection with status code 1000 (NORMAL_CLOSURE)
171171 and specified reason
@@ -177,12 +177,14 @@ Overview:
177177 - a reason that is longer than 123 BYTES is truncated;
178178 - the method blocks outgoing messages (sending methods throw IOException);
179179 - isOpen() returns false;
180- - incoming messages are available until the closing handshake completed.
180+ - incoming messages are available until the closing handshake completed
181+ or closing timeout expires.
181182
182183 void setHandler(WsConnection.Handler newHandler);
183184 - sets the secondary connection handler;
184185 - calls onClose in the old handler (conn.isOpen() returns true),
185- then calls onOpen in the new handler.
186+ then calls onOpen in the new handler;
187+ - throws NullPointerException, IllegalStateException
186188 boolean isPrimaryHandler();
187189 - returns true if it is so
188190
@@ -211,7 +213,7 @@ Overview:
211213 String getQuery();
212214 - returns http request query or null
213215 WsParameters getParameters();
214- - returns connection parameters
216+ - returns the clone of the connection parameters
215217
216218
217219 Interface WsConnection.Handler
@@ -248,10 +250,10 @@ Overview:
248250 - returns true if WebSocket message is UTF-8 encoded text
249251 String asString();
250252 - reads this stream as String;
251- - throws WsError on Exception.
253+ - throws WsError on any Exception.
252254 byte[] asByteArray();
253255 - reads this stream as byte array;
254- - throws WsError on Exception.
256+ - throws WsError on any Exception.
255257 void close();
256258 - closes this stream. Further reading causes an IOException.
257259
0 commit comments