Guest K2k Posted July 26, 2005 Report Posted July 26, 2005 hello, maybe somebody can help me here... I'm working on a programm that uploads Data to a Server via GPRS, it works fine but not via GPRS. When the mobile is connected via wire to the PC then it works (connected to Server via Internet)... has someone maybe a sample source how a connection could work with GPRS? I'm using a socket connection with the TCP Protocoltype. Can someone help me? thx K2k
Guest pai Posted August 10, 2005 Report Posted August 10, 2005 hello, maybe somebody can help me here... I'm working on a programm that uploads Data to a Server via GPRS, it works fine but not via GPRS. When the mobile is connected via wire to the PC then it works (connected to Server via Internet)... has someone maybe a sample source how a connection could work with GPRS? I'm using a socket connection with the TCP Protocoltype. Can someone help me? thx K2k <{POST_SNAPBACK}> To use GPRS maybe look at OpenNetCF
Guest K2k Posted August 29, 2005 Report Posted August 29, 2005 To use GPRS maybe look at OpenNetCF <{POST_SNAPBACK}> thx ;) but that's no help :( sorry... i know that i should use opennetcf and i use it, but i can't find any way to make this code running without the connection to the internet... has maybe someone a source or can help me in a different way :D i can't find the reason why it don't work... thx :) K2k
Guest sp Posted September 13, 2005 Report Posted September 13, 2005 Are you get supply? I get the problem,too. I think maybe we need call some function about open GPRS connect. But... I don't know what's function we can use. good luck to us~ :o
Guest Tech Posted September 13, 2005 Report Posted September 13, 2005 (edited) you need to specify HTTP://thewebaddress.com or HTTP://IP.Address:port :o :( if your server is a webservice (made in ASP.NET) then add a reference to it in your project (assuming your using .NET) and it will automatically connect via GRPS because it knows its a webservice (because of the url) however if it is not a webservice then you need to specify HTTP:// followed by the web address or IP Address (And port) Edited September 13, 2005 by Tech
Guest sp Posted September 13, 2005 Report Posted September 13, 2005 (edited) you need to specify HTTP://thewebaddress.com or HTTP://IP.Address:port :o :( if your server is a webservice (made in ASP.NET) then add a reference to it in your project (assuming your using .NET) and it will automatically connect via GRPS because it knows its a webservice (because of the url) however if it is not a webservice then you need to specify HTTP:// followed by the web address or IP Address (And port) <{POST_SNAPBACK}> Thank your reply~ You mean like this?? private IPAddress serverip = IPAddress.Parse("xxx.xxx.xxx.xxx"); from IPAddress.Parse("xxx.xxx.xxx.xxx")change to IPAddress.Parse("http://xxx.xxx.xxx.xxx") Or ,How can I change form my code? private int portNumber = xxxx; private IPAddress serverip = IPAddress.Parse("xxx.xxx.xxx.xxx"); private void SendData(IPAddress server, Int32 port, string message) { try { TcpClient TcpClient = new TcpClient(); TcpClient.Connect(server, port); byte[] sendBytes = System.Text.Encoding.ASCII.GetBytes(message); NetworkStream stream = TcpClient.GetStream(); stream.Write(sendBytes, 0, sendBytes.Length); stream.Flush(); stream.Close(); TcpClient.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } Edited September 13, 2005 by sp
Guest mike_nz Posted October 18, 2005 Report Posted October 18, 2005 (edited) thx :D but that's no help :D sorry... i know that i should use opennetcf and i use it, but i can't find any way to make this code running without the connection to the internet... has maybe someone a source or can help me in a different way :D i can't find the reason why it don't work... thx ;) K2k <{POST_SNAPBACK}> Try this code, works for me, checks for an internet connections seems to force the default connection on my pda to fire up ie gprs Public Function IsConnectionAvailable() As Boolean ' Returns True if connection is available ' Replace www.google.com with a site that is guaranteed to be online Dim objUrl As New System.Uri("http://www.google.com/") ' Setup WebRequest Dim objWebReq As System.Net.WebRequest objWebReq = System.Net.WebRequest.Create(objUrl) Dim objResp As System.Net.WebResponse Try ' Attempt to get response and return True objResp = objWebReq.GetResponse objResp.Close() objWebReq = Nothing Return True Catch ex As Exception ' Error, exit and return False objWebReq = Nothing Return False End Try End Function PS I seem to be suffering from the same problem, GPRS fires up using the above code but I keep getting host not found errors when trying to connect to the IP address I specify for my TCP socket... this works like a dream across a local network but try it on the internet and it just doesn't want to work, the ip is available as using gprs i can browse a web site on the same ip address. any ideas or example code would be greatly appreciated. Edited October 18, 2005 by mike_nz
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now