Sunday, January 19, 2014
Android phones use GPRS network connection problems Socket
We usually use SOCKET programming for data transmission
For example
/ / Server
ServerSocket server = new ServerSocket (4321);
while (true) {
socket = server.accept ();
. new ServerThread (socket) start ();
}
More open a server connection has been listening for client work
/ / Client
SocketConnection sc = (SocketConnection) Connector.open ("socket :/ / 127.0.0.1:4321");
The above client connection Socket server code.
Once connected to the server will start listening to a Socket object for data transmission.
The question is, I tested for use when the phone if there is WIFI when you can connect to the server-side, data transmission, once the phone is not WIFI, just use the time provided by the operator's GPRS connection, how it can be connected to the server ?
Find Great God
Reply:
I do not use GPRS on
how could the external network IP connectionOn a similar application on your local computer on the Internet can not access a principle
Reply:
You're saying no way connected to the external network to achieve slightly? That GPRS how the WEB page? ? . . . . There certainly can be connected to the external network outside the IP network ah. . .
Reply:
Get Thank you
Reference articles, and finally a WAP connection using Socket, not tested
http://blog.csdn.net/BBHeipy/article/details/5615044
Reply:
Have you tried it? OK No? I had made an application, there is no use GPRS connections can only be used in case of WIFI.
Reply:
No test, go home at night, with the code to know. China is now rarely WIFI connection ah, if you want real-time connection to the GPRS server must be adopted. . .
Reply:
If you have a static IP address of the server, mobile access to the Internet will be able to listen to, and specifically through the Internet it does not matter what. If you do not have a static IP, it can only LAN
Reply:
The landlord to get it? I also encountered the same problem ......
Reply:
The landlord did not solve? I also encountered the same problem. Tangle ......
Reply:
Look at your phone is using CMNET or CMWAP, if the latter requires the agent can
Reply:
To add:
CMNET and CMWAP are two different APN (Access Point Name) China Mobile GPRS network, the reason for this is the control for the purpose of classification. CMNET provides NAT services, using the service can access the internet phone directly. CMWAP provides only a limited range of WAP and HTTP proxy agent, the mobile Internet can be accessed only access IP GPRS network when access (10, *, *, *). So CMWAP mainly for WAP mobile internet, CMNET is for PC, laptop, PDA and other devices to achieve GPRS Internet. There is no difference between the way the mobile Internet, such division is China Mobile to mobile Internet service object orientation is different, so their scope and expense different standards.
Reply:
10 House said was good, and I read the contents of the same. Also said I need to use a proxy
Agents need to use anything in the code of Riga? ? Internet seems to have written, but added to the agency in error. I do not know upstairs have not done this code
Yesterday I tested it using GPRS on my own mobile phone testing, direct use of computer code that ordinary SOCKET communication can upload, do not know my phone is not directly CMNET way to go. I gave my friend the test, he said he only opened CMWAP, so I did not receive his server files.
Reply:
Why is my cmnet has been opened, but the socket is still Rom
Reply:
the access
Hello! Phone use is cmnet, but the test socket is not connected, because the campus network pc with it?
Reply:
Your web server needs outside, not in the local area, if you are in a LAN, but also the need for the server port mapping, as your entire network is a large campus LAN. Then there is a gateway to access internet, access from the outside, just to be able to access your gateway, he can not automatically get to the place you inside the server, look for this process is to be forwarded through the gateway. Mapping work is done when someone visits your server, gateway know where to forward.
Their understanding and experience, there is something wrong, please point out that the exchange
Reply:
Understand it! Thank you, landlord! ! ! !
Reply:
Recently, we just have to do a large-scale application based on gprs, gprs device can support thousands of ways to connect with the socket server.
With open interfaces, we welcome the exchange of test. The ip address 184.169.160.55 listens on port 12345, you can connect the test.
184.169.160.55/GPRS_Free_Test /
Reply:
Recently moved to the company's office software upgrade, you need to use socket to push the development of features to reduce access times to the server terminal equipment to reduce the use of data traffic.
Just to spend, do not know whether to use UDP, the landlord Thousands GPRS devices connect to the server, you need to pay attention to what place?
Reply:
I also LAN server, how the server port mapping?
Reply:
This need to log in to your gateway to set up. Specific settings, please Baidu, many articles, and not repeat them here.
Reply:
Reply moment, concerns similar technology
Reply:
The landlord Hello, I recently also do a GRPS network access server project using, and you encounter the same problem. My server is 192.168.109, it can access the network. How to put the server to the outside Internet address mapping it?
Reply:
Hello landlord, here are a beginner, I recently also studying, I would like to implement a Bluetooth address to get from the client to connect to the phone and through the socket address to the server-side functionality, the question now is can get on the phone to mac Show address, but once I put the socket related. java into the herd without any reaction, seeking answers.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment