13,100
社区成员
发帖
与我相关
我的任务
分享
SocketConnection socket = null ;
DataOutputStream dos = null ;
DataInputStream dis = null ;
try {
socket = (SocketConnection)Connector.open(Util.SOCKET_URL);
dos = socket.openDataOutputStream();
dis = socket.openDataInputStream();
String message = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
dos.writeUTF(message);
dos.flush();
//dos.close();//在JBED中,如果先关掉,那其后的输入流将没有用,正确情况下关掉是正确的。 String result = dis.readUTF();
dos.close();//
dis.close();
socket.close();
}catch (IOException e) {
}