1,打开socket
Socket socket=new Socket(servername,serverport);
2,读取输入流(接收)
byte[] buf = new byte[1024];
int len = 0;
InputStream inputStream = socket.getInputStream();
if(socket.isConnected())
len = inputStream.read(buf);
3,写输出(发送)
OutputStream outputStream.write(ss.getBytes());