• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Couldn't MMS coexist with SMS?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problem 1. if open the MMSListener and SMSListener simultaneously, there is only one which was opened first effective.
such as:
*************
....
MessageConnection mmsconn = (MessageConnection) Connector.open("mms://:8888");

mmsconn.setMessageListener(this);
MessageConnection smsconn = (MessageConnection) Connector.open("sms://:6666");

smsconn.setMessageListener(this);
.....
public void notifyIncomingMessage(MessageConnection conn) {

...
System.out.println("start receive..");
Message msg = conn.receive();
System.out.println("receive complete!");
...
}
*****************
here it can receive multimessage from 888 port.But can not receive textmessage or binarymessage from 6666 port with no exception thrown.there is only
"start receive..." printed.

PS:even remove "mmsconn.setMessageListener(this)" the result is same.
vice versa.

problem 2.it need to shut down mmslistener before send multimessage(sms need not).But if mmslistener was opened before smslistener,then it must shut down all listeners before send sms_message.
such as.
(1)
*******
MessageConnection smsconn = (MessageConnection) Connector.open("sms://:6666");
smsconn.setMessageListener(this);
MessageConnection smsSendconn = (MessageConnection) Connector.open("sms://+XXXX:6666");
......
smsSendconn.send(shortmessage);
*******
this is Ok!
(2)
**********
MessageConnection mmsconn = (MessageConnection) Connector.open("mms://:8888");
mmsconn.setMessageListener(this);
....
MessageConnection mmsSendconn = (MessageConnection) Connector.open("mms://+XXXX:8888");

......
mmsSendconn.send(multimessage);
..
********
In the case,it will throw IOException:Connection closed.
but the mmsSendconn hasn't been closed actually.And if closed mmsconn before send multimessage,then everything goes well.
Like this:
*****
mmsconn.close();
mmsSendconn.send(multimessage);
****
OK!
(3)
MessageConnection mmsconn = (MessageConnection) Connector.open("mms://:8888");
MessageConnection smsconn = (MessageConnection) Connector.open("sms://:6666");
smsconn.setMessageListener(this);

MessageConnection smsSendconn = (MessageConnection) Connector.open("sms://+XXXX:6666");

......
smsSendconn.send(shortmessage);
..
Int this case,the phenomena is the same with (2),all is ok after closed mmsconn and smsconn.

**********
I have tried putting them into different thread,but it is ineffective.
Thanks for your help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic