I have a piece of code to connect to a Socket server, and it works fine.
Socket socket = new Socket(); socket.connect(new InetSocketAddress(address, port));
I`m codding an app with c++ using Socks through Proxy, This tool help me a lot, have a look HERE