import java.net.Socket;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
public class Main
{
public static void main(String[] args) throws Exception
{
Socket socket = new Socket("192.168.100.140", 18890);
String loginCmd = "<Msg><Cmd>Auth</Cmd><Params><LoginName>yiz</LoginName><LoginPass>yizpwd</LoginPass><Version/></Params></Msg>/3";
BufferedOutputStream os = new BufferedOutputStream(socket.getOutputStream());
os.write(loginCmd.getBytes());
os.flush();
BufferedInputStream is = new BufferedInputStream(socket.getInputStream());
StringBuffer sb = new StringBuffer();
while (true)
{
char ch = (char)is.read();
if (ch == '/3') break;
sb.append(ch);
}
System.out.println(sb.toString());
socket.shutdownOutput();
socket.shutdownInput();
socket.close();
}
}