-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added network side type Ping example added Named thread factory can be not daemon Set server connection thread not daemon Added random math
- Loading branch information
Showing
29 changed files
with
545 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/ru/kudesunik/kudesunetwork/handler/NetworkSide.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ru.kudesunik.kudesunetwork.handler; | ||
|
||
public enum NetworkSide { | ||
|
||
CLIENT((byte) 0), SERVER((byte) 1); | ||
|
||
private static final NetworkSide[] values = values(); | ||
private static final NetworkSide[] byId = new NetworkSide[values.length]; | ||
|
||
private final byte id; | ||
|
||
private NetworkSide(byte id) { | ||
this.id = id; | ||
} | ||
|
||
public byte getId() { | ||
return id; | ||
} | ||
|
||
public static NetworkSide getById(int id) { | ||
return byId[id]; | ||
} | ||
|
||
static { | ||
for(NetworkSide ps : values) { | ||
byId[ps.id] = ps; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.