TCP and UDP

Socket based clients and servers

UDP based logging

I never understood why the logging classes in Java and other programming paradigms are so complex - sometimes more complex than the hosting projects. Since 15 years I am fan of UDP based logging. I use this kind of logging in commmercial projects, in complex music software and in embedded projects using very small computers. Therefor I include here a portable UDP based logging receiver called ULS that shows incoming UDP messages and can write them into a file. This can also be used as a simple event logger accepting UDP input from small embedded devices like Arduino, Raspberry Pi, Beaglebone etc. I have prepared two zips: one for Linux (GTK2 based, uses wxWidgets V3.0.1) and one for Windows (uses wxWidgets V2.8.7). Both zips include identical sources and very simple make files (much simpler than the make files used normally in wxWidgets - why are these so complicated?). The client classes used to send UDP logging messages from applications ("hu_trace.xxx") are also included.

Here the reasons why I prefer UDP based logging:

Screen dump for program ULS (the log receiver)


UDP based logging for shell windows

Here is the source code for a much simpler UDP based logging server called udp_server that I use since many years in projects. Normally I include in my C++ sources (also C#, Java etc.) trace functionality as shown in class HU_TRACE (see the uls*.zip mentioned above).

This is a simple command line ("black window") application that you can run under Windows or under Unix/Linux. If you need the trace output then redirect it into a file. This source code does not make use of the above mentioned classes - it uses the API calls for UDP based sockets directly from the operating system.

Screen dump for program udp_server (the log receiver)

Simple UDP client (sender)

Here is the source code for a simple UDP client that sends the contents of a ASCII/ANSI encoded file to an UDP server like ULS or udp_server above. You can specify delays in milliseconds for the send operations. I use such clients to test UDP based logging or to control servers on remote machines by sending configuration options, commands etc.

This is a simple command line ("black window") application that you can run under Windows or under Unix/Linux. This source code does not make use of the above mentioned classes - it uses the API calls for UDP based sockets directly from the operating system.

On my "Programming in D" page I have included two sample programs demonstrating UDP sockets. These two sample programs can be used to integrate an UDP logger in D programs.


Copyright for all images, texts and software on this page: Dr. E. Huckert

Contact

If you want to contact me: this is my
mail address