[J2me]Client and server at the same time?

T

Thibault

Hello all,

I have a strange bug in my midlet. Each of the mobile phone must be client
and server at the same time (via a Bluetooth connection). The problem is
that sometimes (almost one out of ten tries), the server acts strangely. The
server thread hangs on :

streamconnection = streamconnectionnotifier.acceptAndOpen();

(this is normal) but when a client tries to connect with :

streamconnection = (StreamConnection)Connector.open(connString);

the server hangs for 5 seconds (the mobile phone is totally frozen for 5
seconds), then the client throws an IOException whose message is "Connection
rejected". The server doesn't throw an exception, it still waits for a
client to connect.
I have tried lots of things, but this problem still exists. As each mobile
acts as a client and as a server at the same time, there could be the
problem, but I have read a lot of Bluetooth documentation and I can't find
where.

May someone point me in the right direction to debug this ? Any idea is
welcome !

Thank you very much !

Thibault
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,614
Members
45,293
Latest member
Hue Tran

Latest Threads

Top