On 09/10/2017 08:39 PM, David Tiller wrote:
Since WSJT-X uses UDP, there is a chance that you can get more than 1 listener to receive all UDP packets. According to this article, if all clients bind to the port using SO_REUSEPORT (and possibly SO_REUSEADDR), all listeners will receive all datagrams. You may have to convince the author of JTAlert to also make this change if it's not already set.

At least according to socket(7) manpage on Linux, SO_REUSEPORT causes datagrams to be sent to a single listener in a round-robin fashion among all those that are listening, rather than broadcasting to all. It also comes with the downside of requiring modifications to all the listening apps. In some cases I can't even get apps to reliably use a different port.

http://man7.org/linux/man-pages/man7/socket.7.html

Alternatively, you could write a simple listener that repeats all packets heard on several ports.

This is the approach I took. I wrote a trivial Python script to do it:

import socket
s1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s1.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s1.bind(('', 2236))
dports = [2237, 2238, 2239]
while True:
    dgr = s1.recv(16384)
    #print repr(dgr)
    for p in dports:
        s1.sendto(dgr, ('127.0.0.1', p))

As a gist in case the above got mangled: https://gist.github.com/mtharp/eb3937725db09dc38d7da9a104421f03

Should work on Python 2 and 3.

This listens on port 2236 (change the setting in wsjtx to send there) and rebroadcasts to 2237-2239. The reason it doesn't listen on 2237 is because, as I mentioned earlier, some apps seem to ignore me when I tell them to listen on a non-default port, so I had to leave that one for that app. It should be obvious how to modify the script to suit any particular set of ports you like.

-- mike NF4E

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to