Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide direct connect to NTrip server without mountpoint #109

Open
ramtechjoe opened this issue Dec 13, 2022 · 2 comments
Open

Provide direct connect to NTrip server without mountpoint #109

ramtechjoe opened this issue Dec 13, 2022 · 2 comments

Comments

@ramtechjoe
Copy link

In some cases a NTrip server might not have multiple mountpoints and connection is done directly with just the IP and Port. It would be useful if a method was provided for these cases

@dotMorten
Copy link
Owner

Can you provide an example for that? Personally never seen this

@ramtechjoe
Copy link
Author

ramtechjoe commented Dec 13, 2022

I think it might only be something that is only seen with a private base station. I am not 100% sure on my terminology, here. But I think in these cases there is no NTrip Caster, there is an NTrip Source which is connected to directly.

In my case instead of sending a message to an NTrip Caster and getting a list of mount points, then sending the mountpoint name to receive the stream. A direct connection to the socket is made, and just use that, so this kind of replaces your Request method (although passing in the ip/port)

    private Socket OpenSocketDirect(string ip, int port)
    {
        Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        socket.Connect(ip, port);
    
        return socket;
    }

If there was an OpenStream that had no parameters, this could be used to perform this type of direct connect

        public Stream OpenStream()
        {            
            return new NtripDataStream(() => OpenSocketDirect());  //host and port come from constructor
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants