@@ -0,0 +1,770 @@
+public class SmartClientDemo %7B%0A%09public static void main(String%5B%5D args) %7B%0A%09%09SmartSocket socket = new SmartSocket(%22127.0.0.1%22, 6789, new SmartSocket.SmartSocketCallback() %7B%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public void onNewData(SmartSocket socket, byte%5B%5D data) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09System.out.println(%22New data: %22 + new String(data, %22UTF-8%22));%0A%09%09%09%09%7D catch (Exception e) %7B%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public void onInitSuccess(SmartSocket socket) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09socket.send(%22Hello from the client!%22.getBytes(%22UTF-8%22));%0A%09%09%09%09%09System.out.println(%22Sent data%22);%0A%09%09%09%09%7D catch (Exception e) %7B%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public void onFail(SmartSocket socket, Exception e) %7B%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%09socket.suicide();%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D%0A%7D%0A

Create SmartClientDemo.java