Skip to content

Commit 48da1bc

Browse files
Add files via upload
1 parent bdfc979 commit 48da1bc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

com/luneruniverse/simplepacketlibrary/Server.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)