如何从GPRS设备接收数据并将其存储到服务器中 [英] How to recieve data from the GPRS device and store it into the server
问题描述
I have no idea about receiving data from the GPRS device. I don't have any server. I've directly tried TCP Client coding to receive the data but no use.
clientSocket.Connect("59.92.111.69", 8080);
this is how i connected to that ip.
NetworkStream serverStream = clientSocket.GetStream();
TextBox1.Text = TextBox1.Text + "from the receive function";
byte[] inStream = new byte[90025];
int bytesread = serverStream.Read(inStream, 0, (int)clientSocket.ReceiveBufferSize);
string returndata = System.Text.Encoding.ASCII.GetString(inStream, 0, bytesread);
msg(returndata);
serverStream.Flush();
This is what i used to receive data.
I don't know whether this technique is apt to receive data or not. If anyone knows a better way for this please suggest me. Thank you.
我尝试了什么:
我已尝试过TCP IP套接字连接,但我没有从该链接获取任何数据。当我试图接收数据时,电路侧调试输出会产生以下错误信息。
发送OK
+ IPD,506:HTTP / 1.1 400错误请求
日期:2016年4月19日星期二12:38:37 GMT
服务器:Apache / 2.4.9(Win32)PHP / 5.5.12
内容长度:315
连接:关闭
内容类型:text / html ; charset = iso-8859-1
<!DOCTYPE HTML PUBLIC - // IETF // DTD HTML 2.0 // EN>
< html>< head>
< title> 400错误请求< / title>
< / head>< body>
错误请求
您的浏览器发送了此服务器无法理解的请求。
What I have tried:
I have tried in the TCP IP socket connections but i didn't get any data from that link. And also the circuit sides debugging output results the following error message while i am trying to recieve the data.
"SEND OK
+IPD,506:HTTP/1.1 400 Bad Request
Date: Tue, 19 Apr 2016 12:38:37 GMT
Server: Apache/2.4.9 (Win32) PHP/5.5.12
Content-Length: 315
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
Bad Request
Your browser sent a request that this server could not understand.
推荐答案
只需输入 HTTP:// 59。 92.111.69:8080 /
进入浏览器:你会看到有一个网页,而不是GPRS设备。
Just type http://59.92.111.69:8080/
into your browser: you'll see that there is a web page, not a GPRS device.
这篇关于如何从GPRS设备接收数据并将其存储到服务器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!