Do the MIDP APIs support server sockets or HTTP connections?
Created May 7, 2012
Some device manufacturers, however, may choose to implement TCP sockets or other protocols. They may also choose (theoretically) to implement the server portions of those protocols.
You can check on a given device if it happens to support server sockets via the Generic Connection Framework (specified in CLDC and implemented by MIDP devices).
For instance, you might try using 'serversocket' as the protocol type in your Connector.open
call, as:
StreamConnectionNotifier notifier = null;
String url = "serversocket://:" + appPort;
try
{
notifier = (StreamConnectionNotifier) Connector.open (url);
}
catch (Exception e)
{
throw new IOException ("exception opening socket connection");
}
try
{
sConnection = notifier.acceptAndOpen();
}
catch (Exception e)
{
throw new IOException ("exception accepting socket connection");
}