NetTalk Central

Author Topic: Client / server ?  (Read 11589 times)

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Client / server ?
« on: July 07, 2012, 06:29:16 AM »
Hey.
I need some help finding the best approach.
I have several cars with PC's (connected to the Internet). All cars must be connected to a server that sends some status information on various events. If a car loses connection it automatically have to reconnect.
Should the cars be clients or servers?
Which example shows the best approach for my challenge?

Regards Niels

RayA

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • My Web Site
    • Email
Re: Client / server ?
« Reply #1 on: July 08, 2012, 12:51:15 AM »
Hi Niels,
I have worked with many applciations that do that.  First how are your cars connected to the internet.  A lot of public safety org like police and fire use applictions that make use of udp protocal. Thats because of the limited bandwidth that their modems are restriced too.  If the cars have high speed interenet available then you might consider using a mail server to move your status messages and renforced that with a nettalk web server.  I have a few apps that do such a thing using NetTalk.  Maybe a bit more information of what your trying to do with the resources that your using would be helpful.

Ray Abadie
Lafayette, La.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Client / server ?
« Reply #2 on: July 08, 2012, 10:09:55 PM »
Hi Niels,

so there's a simple enough rule;

"The client is the one that will initiate the connection".

For simplicity reasons this almost always means that the cars will make the connection to the server, and hence they are the clients.

Cheers
Bruce

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Client / server ?
« Reply #3 on: July 09, 2012, 12:26:38 PM »
Hi

Thanks to Ray and Bruce.

I created a webservice on our existing webserver. And it works fantastic!!!
And it was even very easy to make, thanks to ws example 42 !

/Niels

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: Client / server ?
« Reply #4 on: February 17, 2013, 07:53:33 AM »
I have several cars with PC's (connected to the Internet). All cars must be connected to a server that sends some status information on various events.

Niels, I am curious how you solved it finally.

I have a similar setup, however the computers are not in cars :-)

For my network I decided to use NetSimple because there I can keep the connection open.

The NetSimpleClients connect to the NetSimpleServer and then sends a "heartbeat" every 61 seconds.

Each time the server responds to each client with a defined answer, like "I received your heartbeat at $CLOCK() $TODAY()".

In some situations the conncetion often drops, so that I find many records of different SockIDs  with old timestamps in the connection queue. Each heartbeat updates the timestamp for the recent connection, all other timestamps get removed after 2 minutes.

In case of a dropped connection the next new connection needs to sync the previous messages, to catch any data which have been lost between the drop and this new connection.

I could pace that heartbeat faster, but its not a critical app, so I can live with a delay of maximal 60 seconds.

I assume you did it similar, but it would be nice to hear if you might have found another approach.

Thanks in advance,
Wolfgang