I urgently need a Java library/helper class for a game. This class utilizes the net, awt, and swing packages to allow players to connect, disconnect, and pass data (objects) to one another. The class is essentially the networking class for a two player board game.
Each side of the socket must have the ability to listen for incoming data and trigger a listener in the class it is helping when it arrives. Each side must also be able to transmit data (objects) at any time by calling a method of the this network class.
Aside from the general network code that creates sockets, there needs to be a method that can be called that creates a popup window that allows a player to enter their own personal tag name (handle or player name) and the IP address and port of the other player with "Connect" and "Cancel" buttons. The "Cancel" button simply closes the popup window and no game state changes occur. The "Connect" button will send a request to the other player. When this player receives the request, another popup window must be displayed that displays the tag name of the player wishing to connect and allows this player to accept or reject the connection through the use of "Accept" or "Reject" buttons. If the player clicks the "Accept" button to accept the connection, the players are connected (constantly listening to one another) and have the ability to transmit data at any time by calling a method of this network class. The "Reject" button simply closes the popup window and sends a message back to the requesting player. This message is not displayed but simply causes the player to begin to listen for connections again. The player who rejected the connection will also begin to listen for connections again.
The data that will be transmitted will be the objects of the game using ObjectInputStream and ObjectOutputStream or another suitable method.
There needs to be a method that allows the game to be in a listening state. When a player starts the game, the game should be listening for connections.
I will provide additional game files so that you are better able to code this network library.
This should not take an experienced Java programmer very long to write, 4-8 hours at the maximum. Thank you and happy bidding!