At Wed, 25 Sep 2019 12:49:36 -0400, David Storrs wrote:
> 1) Is it possible that there is a bug in the underlying C code?

It's always possible. But if I understand the original problem, it
seems unlikely that a bug manages to exactly reconstruct a port number
that has been replaced in a UDP packet by a NAT.


Just to make sure we're talking about the same thing, I'm enclosing
complete code based on your fragments. If I run "server.rkt" first and
then "client.rkt", I see

 me: 0.0.0.0 25891
 reply from: ZZZZ 54545
 reply: #s(transport-address "XXXX" YYYY)

If I run as-is, using "localhost" as the server shown by ZZZZ, then
XXXX and YYYY are `127.0.0.1` and `25891`, as expected. I change
"client.rkt" to connect to a remote host where my client is behind a
NAT, then XXXX is my NAT's address and YYYY is something other than
25891 --- and that YYYY persists over multiple runs of "client.rkt" and
"server.rkt" in some complicated way that does indeed seem to be at
least tens of seconds. (My NAT is an AirPort.)

If I understand, you're seeing YYYY as always 25891, and you have good
reason to think that the NAT isn't just using 25891 as a convenient
substitute for 25891. I have no explanation.


> 2) Why does Racket use a hand-rolled io library instead of a more
> standard net stack element?  Is it for portability or...?

As you say, rktio provides a portable interface non-blocking I/O and
some other OS services.

I forget which libraries I tried back around 1995-96. There wasn't an
obvious choice like libuv at the time. I remember there was library for
Mac OS Classic that provided a Unix-like layer, but I wasn't happy with
it. Some frameworks were starting to build up abstractions, I think,
but only by buying into a lot more of a framework. So, after building
up abstractions that provide exactly what Racket needs over a decade or
two, it would be a lot of work to rebuild on a different library, and
I'm not seeing a pressing need.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20190925185714.607D365019B%40mail-svr1.cs.utah.edu.

Attachment: common.rkt
Description: Binary data

Attachment: server.rkt
Description: Binary data

Attachment: client.rkt
Description: Binary data

Reply via email to