Results 1 to 7 of 7
- 08-24-2008, 01:09 PM #1Member
- Join Date
- Aug 2008
- Rep Power
- 08-24-2008, 01:57 PM #2I can not do that.
If your communication is only String and has no binary capability, you will have to convert the floats to String and have an agreement/protocol with the server code so it knows what it is receiving and how to handle it.
Are you sure you can't sent binary?
If you send binary, the server will have to know how to reconstruct the data back into useful info.
- 08-24-2008, 06:00 PM #3
Over TCP/IP, you sent bytes. Its the rule.
It is really a bad idea to send float or int, as you need to be sure that both sides interpret the bytes and bits the same. Google big endian and little endian for examples.
Corba and other complex systems are about marshalling and unmarshalling binary things so they are understood on both ends. Of course Corba is complex and arcane itself.
Advice: move string representations. Convert to and from binary as needed.
- 08-29-2008, 12:47 PM #4
Novadays it is possible to use string-based JSON format. There are bunch of libraries for any programming language.
Ref www dot json dot org
- 08-29-2008, 08:28 PM #5
- 08-29-2008, 10:42 PM #6
Why binary ? JSON produces human-readable text stream. Advantage is that you do not need to write your own serialization/deserialization code - this is what JSON library does for some primitive types and objects.
Last edited by ProjectKaiser; 08-29-2008 at 10:52 PM.
- 08-30-2008, 03:48 AM #7
But I believe its a weak design to send binary when you can simply send text messages. You can send text with two or three lines of simple Java, no libraries, no API, nothing fancy. To me, this is much better.
- By Hinty in forum NetworkingReplies: 2Last Post: 03-14-2009, 08:39 AM
- By lene in forum NetworkingReplies: 0Last Post: 04-23-2008, 04:29 PM
- By durahman in forum New To JavaReplies: 2Last Post: 02-12-2008, 01:17 AM
- By mew in forum New To JavaReplies: 4Last Post: 12-29-2007, 06:08 PM
- By bbq in forum Advanced JavaReplies: 1Last Post: 06-05-2007, 02:08 AM