hi..
i'm testing a modified source of sample chat server source.. client program
is flash,
flash transmitted message that added "\r\n" to the message.
and java server(multi-thread base) is return message that added "\0" to the
return message.
i used same source the recevie and send part. first message is not problem.
server is recevied and return ok message the client, and client is recevied
ok message. but client next message is sent to server, server received empty
message.
what is problem?
[ client source ]
function handleIncoming (messageObj) {
var tag=messageObj.firstChild.firstChild.nodeValue;
if(tag == "LOGINS"){
mySocket.send("PN\r\n");
}
}
mySocket.connected = true;
mySocket.send("LOGIN"+"\t"+userid+"\r\n");
[ /client source]
[server source]
public void messageReceived(IoSession session, Object message) {
Vector vectorTmp = new Vector();
String theMessage = (String) message;
System.out.println("theMessage = "+theMessage+", user="+(String)
session.getAttribute("user"));
StringTokenizer str=new StringTokenizer(theMessage, "\t");
while(str.hasMoreTokens()){ vectorTmp.addElement(str.nextToken()); }
String theCommand = vectorTmp.elementAt(0).toString();
String UserID = vectorTmp.elementAt(1).toString();
if ("LOGIN".equals(theCommand)) {
sessions.add(session);
session.setAttribute("user", UserID);
session.write("<head>LOGINS</head>\0");
}
[/server source]
--
View this message in context:
http://www.nabble.com/problem-the-communication-to-cross-platform%28flash%29..-tf4264788s16868.html#a12137370
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.