Niels Hofmans:
> Hello Wietse,
>
> I am just reading 1024 bytes at a time, I do not think I am truncating
> anything?
buf := make([]byte, 1024)
_, err := conn.Read(buf)
I suspect that this will not read a larger than 1024-byte datagram
properly. That's primarily based on searching the web and finding
that people use more sophisticated APIs than Read() for handling
I/O over UDP. Unfortunately, I don't have time for a deep dive into
Go documentation.
I do appreciate that one may want to be isolated from host details
such as where the logging is filed. I would be more at ease with a
making a real syslogd write to stream, because that is what they are
designed to do well.
Wietse
> And with not keeping up, I will take a look.
>
> Niels
>
> Sent from my mobile
>
> On 23 Aug 2018, at 20:10, Viktor Dukhovni <[email protected]> wrote:
>
>
>
> > On Aug 23, 2018, at 2:00 PM, Niels Hofmans <[email protected]> wrote:
> >
> > My logger binary is only ran on startup, so would mean the socket
> > disappears again on next start.
> > Also, it does close/unlink the socket whenever the program exits.
>
> Sure, if /dev/ is a non-persistent directory. And I don't
> how Go-lang implements the unix-domain listen and close
> methods. If those do the unlink, you're fine. Still,
> worth checking that this is sure to be reliable.
>
> In some cases /dev is persistent, but if it is a ramfs,
> created fresh each time, then you're fine.
>
> --
> Viktor.
>
>
>