# `dgpsip.c`

Functions:- | This file provides the actual services for dgpsip corrections to `dgnss.c`.
--- | ---
Notes based on code as of Mon Apr 5 21:38:06 2010 -0400.
`int dgpsip_open(struct gps_context_t *context, const char *dgpsserver)` | Tries to open a connection to a dgpsip server. Returns either -1 on failure or the socket number on success. On success, it initializes the connection, sends a HELO to the server and stores the type of dgnss service in the context data.
`void dgpsip_report(struct gps_device_t *session)` | If we have not contacted the server and we have at received least 10 fixes, send a report to the server and set the flag, so we don't do it again.
`static int srvcmp(const void *s, const void *t)` | Compare the distance of two servers from our location. Return -ve, 0 or +ve depending if server `s` is nearer, the same distance away or further away than server `t`.
`void dgpsip_autoconnect(struct gps_context_t *context, double lat, double lon, const char *serverlist)` | This function takes a list of servers and tries to get a connection to the closest one relative to our location. If no servers are within 1600 km or none are in the list, the dsock value is set to -2 to lock out the function.