>>> Any idea?
>> You seem to want to use two incompatible streams. If you wish to send
[quoted text clipped - 10 lines]
> read/write UTF is providing string, doesn't tell the type of object. Do
> you have more info?
You need to design a protocol to do this.
You might decide that every object is preceded by a message that gives
its type and any other necessary information. You may then find you need
additional messages that do not precede an object, such as messages that
identify the client or say that the client is ending the session. You
may want the server to send a message back after it has received each
object to confirm that the object is OK. So, you need to design a
structure for the messages (I like to use an ASCII string containing
comma separated fields) that is easy to recognize, decode and validate.
Write it down. Check that all possibilities are covered. Make sure that
errors are recoverable and that there is no possibility that the
protocol can get stuck.
Then, and only then, start coding. Make sure your clients and servers
can produce diagnostic traces of the running protocol. You'll need that
for certain.

Signature
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |