SockeTcp01Client.javapackageorg.example.socket;importjava.io.IOException;importjava.io.InputStream;importjava.io.OutputStream;importjava.net.InetAddress;importjava.net.Socket;publicclassSocketTcp01Client{publicstaticvoidmain(String[]args)throwsIOException{Socketsocket=newSocket(InetAddress.getLocalHost(),9999);System.out.println("客户端socket返回"+socket.getClass());OutputStreamoutputStream=socket.getOutputStream();byte[]content="HelloServer,This is a message come from Client".getBytes();outputStream.write(content);outputStream.close();socket.close();}}