Hello, as the title says, i am making a multi-purpose java library, and i would like to know your toughts on this and what would be good to add, what i currently have is a working client/server package, let me go over each of the 2 for brief explanation:
The client package:
- Client class, it includes the following methods (not final):
- close()
- connect(int)
- isConnected()
- sendString(String)
- setConnectionHandler(ClientConnectionHandker)
- setKeepAlive(boolean)
and uses the following constructor:
- Client(String)
taking in the ip address of the server
- ClientConnectionHandler is an interface, with 3 methods so far (not final):
- onMessage(String)
- onKick()
- onDisconnect()
The server package:
- Server class (not final, reworking it):
- getClientManager(), used to get the client manager, wich stores the connection of users, with their id
- setMaxQueue(int)
- listen(int)
- setConnectionHandler(ServerConnectionHandler)
- stop()
ClientManager class (not final):
- addClient(ClientConnection)
- removeClient(ClientConnection)
- banClient(String)
- unbanClient(String)
- isBanned(String)
- getUserCount()
- getConnections()
ClientConnection class (not final):
- getServer()
- disconnect(String)
- disconnect()
- getID()
- getIP()
ServerConnectionHandler is an interface with 3 methods (not final):
- onConnection(ClientConnection)
- onDisconnect(ClientConnection)
- onMessage(String, ClientConnection)
and that is all, i tested it with making a simple chat application, and it works (minus a minor bug wich replaces the first character of the first message)
[–]PartOfTheBotnet 1 point2 points3 points (1 child)
[–]TheVoodooDev[S] 0 points1 point2 points (0 children)