packet is able to be generated properly, and the server now connects as a thread, soon to add packet sending with it.
Server finally works. The getClientMessage() function works and it works as a thread.