Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Java2ME ServerSocketConnection: ConnectionNotFoundException

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I'm using Java2ME (MIDP2.0) to establish server connections on my device. However, I'm having trouble using the Connector.open method to construct a ServerSocketConnection instance. I use the following code:

ServerSocketConnection serv = (ServerSocketConnection) Connector.open("socket://:80");

I get the following ConnectionNotFoundException: "Cannot create socket, //:80". I do not think this is a security issue: for one, because I don't get a SecurityException, and secondly because I explicitly ask for permission to use ..Connector.socket, ..Connector.http, and ..Connector.serversocket in the JAD file. I haven't tried signing the midlet suite yet, as this would take quite some time and I'm actually just testing some code. I've also tried using another port (and using "serversocket://:80" instead of "socket://:80", more out of desperation); also, I have tried entering "localhost" and "127.0.0.1" in front of the port number, but all to no avail. I have been able to successfully use this method to construct SocketConnection instances, however. Can this be because my particular device (HTC Touch Cruise, JBED build 20080428.2.1) simply does not support server socket connections?


Thanks in advance,

William
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic