Tools:I have midlet with Visual Form, named form and form1
- form i used to take the informations from user nothing more.
- form1 is the SIP register on load, button call connect, button hangup.
- S40 emulator for cldc
- S60 emulator for cldc
- Sun cldc emulator
Problem: - when form1 load under S40 emulator and in Sip server, i see registered successfully.
- when the same code i test in S60 emulator, the time it load form1, whole emulator crash close, server i dont see any registration log.
- the same code when i test with NetBeans cldc emulator, it show
Warning: To avoid potential deadlock, operations that may block, such as networking, should be performed in a different thread than the commandAction() handler.
Code:// Form1 Load public Form getForm1() { if (form1 == null) { form1 = new Form("Test", new Item[] { getImageItem1(), getImageItem2(), getTo() }); form1.addCommand(getSendCmd()); form1.addCommand(getExitCmd()); form1.addCommand(getHangupCmd()); form1.setCommandListener(this); fRegister(); // This is the Big problem... } return form1; } // data send/recv public void fRegister(){ try { rtpCon = (UDPDatagramConnection) Connector.open("datagram://:"); sdpPort = rtpCon.getLocalPort(); provider = new SIPProvider(UserName,passwd,SipServerIP, SipServerPort, 1225); provider.start(); provider.addSIPProviderListener(this); } catch (Exception ex1) { ex1.printStackTrace(); } } // Form command public void commandAction(Command command, Displayable displayable) { if (displayable == form1) { if (command == exitCmd) { // Exit } else if (command == hangupCmd) { // Hangup } else if (command == sendCmd) { // Send } } }

Reply With Quote


