how to use udp, for sending data server to client
I try to make an application that communicate server by udp. i easly send data from client(j2me device) to server. but there is problem when i try to send data from server to client.
i make server pc as both server and client, and phone become also both server and same time client.
when i send a data from phone to server, i use phone's client side and send data to server pc's server side. and when i send data from server to phone.
my code is working good in emulators. but, in real device, it dont work.
where is problem, do you think?
Re: how to use udp, for sending data server to client
please specify device if you have issues with real device,
have you followed example implementations?
(shipped with Sun WTK)
also search Tech Library,
[quote]Using receiving and sending threads on a single UDP connection block each other
When using two threads on a single UDP connection, receiving and sending block each other.
Series 40 1st Edition, Series 40 2nd Edition, some S40 3rd Edition devices
All Series 40 1st Edition and Series 40 2nd Edition devices, Nokia 6270, Nokia 6280 (only sw version 3.xx), Nokia 7370, Nokia 6111
April 21, 2006
When using two threads on a single UDP connection, receiving and sending block each other. If an application sets up the receiving thread before sending the first packet, then it will become deadlocked. Also, while it is waiting for a response from the server, it can't retry sending.
How to reproduce
Use an alternative implementation method. If possible, always set up a sending thread first.
This is fixed in newer Series 40 3rd Edition devices.[/quote]