emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UDP: Send and receive on same port?


From: Mario Lang
Subject: Re: UDP: Send and receive on same port?
Date: Tue, 30 Mar 2021 23:03:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux)

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Tue, 30 Mar 2021 13:11:47 +0200, Mario Lang <mlang@blind.guru> said:
>
>     Mario> Replying to self
>     Mario> Nevermind, it works by creating a datagram server first, and then 
> using
>     Mario> set-process-datagram-address to set the destination.  The server 
> process
>     Mario> can now be used to send UDP as well.  However, I am seeing lost 
> incoming
>     Mario> packets.  According to tcpdump, the reply is clearly there, but the
>     Mario> process filter only seems to pick it up 1 out of roughly 4 times.
>     Mario> Weird.
>
> Hmm, I have a patch somewhere to allow setting the sending port
> directly, Iʼll see if I can find it and resurrect it.

OK. However, we'd also need a way to get the listening port of a server
process with :service t.  At least I haven't seen a way to query the
listening port yet.

> Having said that, this sounds like it might be a bug (although I
> haven't checked if the emacs code supports sending from a datagram
> server like this).

It does works, and also flawlessly.  The weirdness I saw was due to a
coding-system issue, `osc-make-server` did not set :coding 'binary,
which is now fixed.

> Could you open a bug with M-x report-emacs-bug with your emacs
> version, and sample code?

I'd rather not, since this behaviour is actually wanted.
It is the only way I have to communicate with a certain external program
directly from elisp.  scsynth always replies to the sender port...

To reproduce, all you need is create a datagram server, and set the
datagram-address to the desired destination.  You can now receive
datagrams, and also use process-send-string to send to the desired
destination.

-- 
CYa,
  ⡍⠁⠗⠊⠕



reply via email to

[Prev in Thread] Current Thread [Next in Thread]