You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Dawn <pe...@gmail.com> on 2006/05/30 00:13:37 UTC

TCP/IP Communication Problem

hi all,

i am working on implementing TCP/IP socket communication within my web
app. I have been able to send messages from a set port to an external
application (a dummy server program) and that application is able to
receive my send messages.

however I am unable to receive messages back from the external
application. actually when the application does send something back I
am able to read something, but its all gibberish.

this is my code for receiving data from the application,

int avInt = in.available();			

String avStr = "";
Debug.println("Number of bytes sent: " + avStr.valueOf(avInt));
			
int x = 0;
StringBuffer y = new StringBuffer();
while (x < avInt) {
    char b = in.readChar();
    String a = "";
    y.setLength(1);
    y.setCharAt(0,(char)b);
    Debug.println("+++++" + y.toString());
    x++;
}

now when i send asdfas from the server, i receive
+++++?
+++++?
+++++?
+++++?
+++++?
+++++?

obviously i am expecing to read asdfas.

any help guys. thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org