File tree Expand file tree Collapse file tree
com/luneruniverse/simplepacketlibrary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,12 +144,13 @@ public boolean isConnectAllowed() {
144144 /**
145145 * Start the server <br>
146146 * Use addConnectionHandler to know when clients have connected
147+ * @return this
147148 * @throws IOException if an I/O error occurs when opening the socket
148149 * @see #close()
149150 */
150- public void start () throws IOException {
151+ public Server start () throws IOException {
151152 if (isAlive ())
152- return ;
153+ return this ;
153154
154155 socket = (useWebSocket ? new StandardWebSocketServer (port ) : new StandardServer (new ServerSocket (port )));
155156 thread = new Thread (() -> {
@@ -175,6 +176,8 @@ protected void onClose() {
175176 }
176177 }, "Server [" + port + "]" );
177178 thread .start ();
179+
180+ return this ;
178181 }
179182
180183 /**
You can’t perform that action at this time.
0 commit comments