My Android app is exchanging traffic messages via UDP with a server -
binary messages of up to 60 Bytes. The server I'm using (external,
don't have access to code nor can I convince the developer to change
stuff :( ) is identifying the clients solely through sockets (no other
type of client ID whatsoever), so I need to use the same socket for
receiving and sending. My initial plan was to use separate Threads for
receiving and sending data. The network load depends on the traffic
situation - sometimes there might be a lot of messages coming in,
sometimes only a few. The client also needs to send periodic keep-
alive messages, which are simple, 10 character strings. Now the
problem is that Java's DatagramSocket.receive method() is synchronized
and also blocking as long as there is data to receive, so my sending
thread cannot use the socket for sending anything, which results in
the server kicking off the client because there's no response coming.

My question is, how bad (or not bad) do you think will rejecting the
threads and doing all the networking as described above in the UI
thread be? Of course, if you also have suggestions on how to overcome
the issue, it will be greatly appreciated!

Cordialement

Lex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to