Wrote this code for a project I was working on.
Download both the files (TCPDataClient.java and TCPDataServer.java), compile and run TCPDataServer.java first followed by TCPDataClient.java in order to make the code work.
The Output "Connection Established", displays on the Server-side console.