Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
cornplay
Posts: 20
Registered: ‎11-17-2008
My Device: Not Specified

ServerSocketConnection in Mobile Hotspot mode

I'm trying to open ServerSocketConnection on a BlackBerry 9900 OS 7.1 when it is in Wi-Fi Hotspot mode.

 

 

import java.io.IOException;

import javax.microedition.io.Connector;
import javax.microedition.io.ServerSocketConnection;

public class ServerSocket {

	private ServerSocketConnection mServerSocket;

	public ServerSocket(int port) throws IOException {
		mServerSocket = (ServerSocketConnection) Connector.open("socket://:" + port + ";interface=wifi");
	}

	public Socket accept() throws IOException {
		return new Socket(mServerSocket.acceptAndOpen());
	}

	public void close() throws IOException {
		mServerSocket.close();
	}

	public String getLocalAddress() throws IOException {
		return mServerSocket.getLocalAddress();
	}
	
	public int getLocalPort() throws IOException {
		return mServerSocket.getLocalPort();
	}
}

 

Unfortunately, I always got java.io.IOException: No Wi-Fi connection. Is it not supported?

 

Please use plain text.
New Member
renatoarg
Posts: 2
Registered: ‎10-25-2012
My Device: Bold 9900

Re: ServerSocketConnection in Mobile Hotspot mode

Hello friend, how are you?

 

I´m trying to do the same you did, connect my BB to my notebook using hotspot connection and sockets.

 

I also can't figure out how to do it.

 

Did you manage to solve this problem? Could you please share?

 

Thanks a lot !!

Please use plain text.
Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: ServerSocketConnection in Mobile Hotspot mode

I would also like to be able to use hotspot in this way.

 

RIM, whats the connection string?!

Please use plain text.