1 Reply Latest reply on Jul 23, 2009 3:51 PM by Joe ... Ward

    Air Application connecting to Java Socket Server

    andrewthorp

      Ok, I basically have two questions:

       

      1) When I connect to a java socket server, mind you it is an XMLSocket, I need to do two things.  The first, which is working, is that the java socket needs to refresh whenever the database it is listening to changes, this is done on the java side, watching the db for changes.  The second thing is I need to be able to post back to the socket server and search the database.

       

      This is how I am attempting to do that (only showing applicable code) - socket is my XMLSocket:

       

      var ba:ByteArray = new ByteArray();

      ba.writeMultiByte( mySearchString, "iso-8859-1" );

      socket.send( ba );

       

      Now, when I do this, there is two problems.

       

      First, the socket server isn't actually getting this information (via readline) until the AIR application is quit, almost like the AIR app is not sending data til I quit.

       

      Second, the socket server is getting it... in odd format, for instance if my search string is 'test', it will get it like this: 'ttetestest', like it is appending 1 character at a time.

       

      Any help is greatly appreciated!