I am developing j2me app. I need to receive sms on specific port. Which is the best port to define for receiving sms? Thanks for advice
问题:
回答1:
The SMS spec (JSR 120) says you can't have a port that another app is using at that time, and also you can't have any of the ports that are specified in the following table.
For security reasons, Java applications are not allowed to send SMS messages to the port numbers listed in Table A-4. Implementations MUST throw a
SecurityException
in theMessageConnection.send()
method if an application tries to send a message to any of these port numbers.Table A-4: Port Numbers Restricted to SMS Messages
Port number Description
2805 WAP WTA secure connection-less session service
2923 WAP WTA secure session service
2948 WAP Push connectionless session service (client side)
2949 WAP Push secure connectionless session service (client side)
5502 Service Card reader
5503 Internet access configuration reader
5508 Dynamic Menu Control Protocol
5511 Message Access Protocol
5512 Simple Email Notification
9200 WAP connectionless session service
9201 WAP session service
9202 WAP secure connectionless session service
9203 WAP secure session service
9207 WAP vCal Secure
49996 SyncML OTA configuration
49999 WAP OTA configuration
Oddly, I can't see any restriction on any other values of the port number. I'm sure this must be set out somewhere but I can't find it in the spec.
However, I strongly suggest restricting yourself to port numbers between 1 and 65535.
回答2:
Generally 5001 port is use for such operation. you can see very good example here.