如何从GPRS设备接收数据。 [英] How to recieve data from the GPRS device.

查看:216
本文介绍了如何从GPRS设备接收数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用TCP / IP技术接收数据。我使用TCP客户端程序从IP59.92.111.69主机8080接收数据。



我无法接收任何数据。请建议我从上面的ip接收数据的好方法。



我尝试了什么:



我试图使用TCP / IP技术接收数据。我使用TCP客户端程序从IP59.92.111.69主机8080接收数据。



我无法接收任何数据。请建议我从上面的ip接收数据的好方法。

I tried to receive the data using TCP/IP technique. I used the TCP client program to receive the data from the IP "59.92.111.69" host "8080".

I can't receive any data. Please suggest me a good technique to receive data from the above ip.

What I have tried:

I tried to receive the data using TCP/IP technique. I used the TCP client program to receive the data from the IP "59.92.111.69" host "8080".

I can't receive any data. Please suggest me a good technique to receive data from the above ip.

推荐答案

如果是标准的GPRS调制解调器,你需要在连接TCP / IP后发送这段代码

If it's a standard GPRS modem you need to send it this code after connecting the TCP/IP
GET / HTTP/1.0<cr><lf>
Connection: keep-alive<cr><lf>
<cr><lf>



cr =回车(ascii字符代码13)

lf =换行( ascii字符代码10)



在你要求HTTP服务器开始发送之前它不会发送任何内容。



它会回复

HTTP / 1.0 200 OK然后数据会继续喷出。



如果你想一想,你会明白为什么,在连接TCP / IP后,GPRS无法知道你什么时候准备接收数据。当然,您可能已连接,但您可能尚未准备好接收数据。因此,您必须通过发送命令来启动HTTP服务器,该命令就是这样做的,以及它与Web浏览器的作用: - )


cr = carriage return (ascii character code 13)
lf = line feed (ascii character code 10)

It wont send you anything until you ask the HTTP server to start sending which is what that does.

It will respond with
HTTP/1.0 200 OK and data will then continue to spew out.

If you think about it you will see why, the GPRS has no way to know when you are ready to receive data after you connect on TCP/IP. Sure you may have connected but you may not be ready to recieve data. Hence you have to initiate the HTTP server to start by sending a command which is what that does and its what a webbrowser does :-)


这篇关于如何从GPRS设备接收数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆