Need to close TCP socket to send data

Hi, I started working on Network stuff with Sockets and Networking module recently, and I’m stuck on a problem.

I made a Java server to receive packets send by my game client, it work well, but I need to send and close socket from my game to send data, if I simply use send function nothing happen.

Here my code: hastebin

Thank you in advance !

Cordially, Jackblue