News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

HTTP Time Server

Started by Biterider, July 13, 2024, 07:29:26 PM

Previous topic - Next topic

Biterider

Hi
If you are working with Industrial IoT, you will have noticed that synchronising devices on a network is not a simple task. In most cases, you will have a PC connected to the network that can host a server to provide a time service that can be accessed by IoT devices.
Windows PCs have the ability to provide an NTP server as a built-in service that can be easily enabled and you are ready to go.
However, not all devices have the software capability to connect to such a server. On the other hand, HTTP capabilities are widely available. This is where the HTTP Time Server comes in.
ObjAsm has a powerful and robust implementation of an IOCP server. With a few small modifications to the protocol implementation, an HTTP time provider was implemented.
After a few days of operation, no leaks were found and it runs smoothly.

Accessing it is as simple as sending "http://xxx.xxx.xxx.xxx:25773/GetTime" which will return "17:25:25.324" for example.
A device can query the server every time it needs the time, or it can use this string to synchronise an internal clock.
To test the server on the same machine, a loopback connection in the form of "http://127.0.0.1:25773/GetTime" or "http://localhost:25773/GetTime" can be used.

Some additional commands are implemented such as GetDate, GetDateTime and the UTC variants GetTimeUTC, GetDateUTC and GetDateTimeUTC.

Attached are 2 file:
- NetCom protocol file that implements the server
- The Server as binary file and a pdf help file

Regards, Biterider

Biterider

#1
Update:
I added a few command line switches to the application.
The most important is /Port to specify the used port. The default is still 25773.
E.g.
HttpTimeServer.exe /Port:13
The pdf file is updated to reflect this change. See first post.

Biterider

Biterider

Update 2:
Moved date/time procs to ObjMem.
Proctocol need small changes to use the right ANSI/WIDE procs.

Updates in the first post.

Biterider