Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6538797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:46:45+00:00 2026-05-25T10:46:45+00:00

I am writing at NTRIP client on WM6. Basically I am getting data from

  • 0

I am writing at NTRIP client on WM6. Basically I am getting data from a server using sockets by first sending a configuration. But I am unable to get it working over a GPRS connection on the same device.

I send this message.

Get / HTTP/1.0
User-Agent: NTRIP client
Accept: */*
Connection: close

To this server.

Hostname: mamba.gps.caltech.edu
Port: 2101

I make the connection by doing this

string message = "GET / HTTP/1.0\r\nUser-Agent: NTRIP client\r\nAccept: */*\r\nConnection: close\r\n\r\n"
IPAddress ipAddress = Dns.GetHostEntry(hostname).AddressList[0];

_NTRIPCaster = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_NTRIPCaster.Connect(new IPEndPoint(ipAddress, Convert.ToInt32(port)));
_NTRIPCaster.Send(Encoding.ASCII.GetBytes(message));
for (int i = 0; i < 50; i++) //Wait for upto 5 seconds for a response
{
     Thread.Sleep(100);
     if (_NTRIPCaster.Available > 0)
     {
           Byte[] inBytes = new byte[_NTRIPCaster.Available];
           _NTRIPCaster.Receive(inBytes);
           sourceTable += Encoding.ASCII.GetString(inBytes, 0, inBytes.Length);
           //Check if all of the Source table has been recieved
           if (sourceTable.Contains("ENDSOURCETABLE")) 
           {
                 sourceTableRecieved = true;
                 break;
           }
      }
}

This all works fine if I have a Wi-Fi connection, or the device is docked to a PC and active sync is sharing the PCs internet connection.

If I cut off the internet on the PC, and disable the Wi-Fi then its unable to resolve the hostname to an IP address. Doesn’t even get to the socket connections. Basically it is not using the modem in the device and making use of a GPRS connection. This happens whether the GPRS is connected or not.

Since I am on WM6, I have looked at the connection manager API – http://msdn.microsoft.com/en-us/library/aa458120 .

But after following a few other posts I have been able to find on stackoverflow and other forums I have been unable to get it to work. Does anyone know how I can make a GPRS connection and start sending data to a server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:46:46+00:00Added an answer on May 25, 2026 at 10:46 am

    After alot of experimenting I got it to work.

    Used the ConnectionManager, in SDF from OpenNetCF

      ConnectionManager connectionManager = new ConnectionManager();
      connectionManager.Connect(false);
      Thread.Sleep(50); //Give it time to make a connection
    

    Next, I used the TCP/IP method of connection. Honestly, I am not sure how this differs to sockets with a TCP protocol, as from what I can tell a TCPClient object, has a property called Client which itself is a socket. Stripped down sample of code below.

           using (NetworkStream ns = _client.GetStream())
           using (MemoryStream ms = new MemoryStream())
           {
               ns.Write(messageBytes, 0, messageBytes.Length);
               for (int i = 0; i < 50; i++)
               {
                   Thread.Sleep(20);
                   byte[] buffer = new byte[16 * 1024];
                   int bytes;
                   while ((bytes = ns.Read(buffer, 0, buffer.Length)) > 0)
                   {
                       ms.Write(buffer, 0, bytes);
                   }
                   byte[] data = ms.ToArray();
                   response += Encoding.ASCII.GetString(data, 0, data.Length);
               }
    

    I am now getting data sent and received as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing an iPhone app, and I'm getting my data from a REST API that
Writing a client / server program and previously was using calls like this: TcpListener.AcceptTcpClient()
writing a server that runs on linux (Ubuntu) using mono. and a client that
Writing an asynchronous Ping using Raw Sockets in F#, to enable parallel requests using
Writing my first JQTouch app. When I go from #login to #home , a
Writing my first app with CoreData. The book I'm using to guide me has
Writing an HTTP simple server on top of Net node.js module, not using HTTP
Writing something like this using the loki library , typedef Functor<void> BitButtonPushHandler; throws a
Writing my first Linq application, and I'm trying to find the best way to
Writing a python program, and I came up with this error while using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.