Blackberry can't accept connection via Mobile Network?
On Blackberry, I want to open a server socket to listen connection come from others device.
Here's my code:
String url = "socket://:12345;deviceside=true";
ServerSocketConnection scn = (ServerSocketConnection) Connector.open(url);
SocketConnection sc = (SocketConnection) scn.acceptAndOpen();
Mobile network on that BB is ok, but it can not accept any connection. I also use its mobile network to开发者_运维百科 connect to other servers, it work fine when it is client socket.
I have tried with Wifi network, and it work fine.
String url = "socket://:12345;interface=wifi";
ServerSocketConnection scn = (ServerSocketConnection) Connector.open(url);
SocketConnection sc = (SocketConnection) scn.acceptAndOpen();
I think, Mobile Network Service prevented when others device connect to it, is it true?
Please explain to me, many thanks !
On most cellular networks, there is no way to receive inbound connections on a device. Not only is the device behind a carrier level NAT, there are explicit blocks in place to prevent data from traversing the network when not initiated by a device.
In short, you can't run a server on a cell network.
精彩评论