Hi folks,
In my j2me appln im trying to tranfer a profile(string) using RFCOMM between two BT devices.
Even after creating separate classes called BlueServer and BlueClient and started separate threads for sending and receiving profiles , the warning for deadlock is still there.Plz have a glance at following sample snippets.
public void commandAction(Command c,Displayable d){
if(c==sendProfilecmd){
blueServer=new BlueServer(this);
blueServer.start(); //deadlock
}
}
The run() method of BlueSever class is:
public void run(){
serverconn = (StreamConnection)notifier.acceptAndOpen();
try {
out = serverconn.openOutputStream();
out.write(msgData.length >> 8);
out.write(msgData.length & 0xff);
out.write(msgData);
} catch (IOException e) {
System.err.println("Can't send data: " + e);
}
}
plz tell me what mistake i have done here.Any probs with the Thread i have created.Please help me.
Thanks in Advance
yafy.

Reply With Quote

