3 ms·
> To me, an individual TCP port + IP is, effectively, giving me a 'virtual uart'. It's not, though. A single destination can have an arbitrary number of socke
by ajross 5y ago
> To me, an individual TCP port + IP is, effectively, giving me a 'virtual uart'.
It's not, though. A single destination can have an arbitrary number of sockets/uarts connected to it. You can server on port 80, and accept a connection from 127.0.0.1 and from 192.168.100.23 and from 10.98.54.4 and from anywhere else on the internet and have them all operating simultaneously. And in fact each destination port can have many connections to the same IP and port combination, discriminated by the source port which is a number the programmer generally never sees (unless you bind it specifically, it's automatically assigned).
It's exactly that kind of almost-right-but-not-quite mental misrepresentation that the article is trying to address.
- GeorgeTirebiter 5y agoI don't think you fully understood my point. What I'm saying is that when any comm happens between network endpoints, it's essentially identical to a uart stream. The fact that a tuple (my IP, my socket, your ip, your socket, protocol) is used instead of COM4 is just a detail.
- foxfluff 5y agoWrite into a uart looks like this: write(fd, "hello", 5); write into a connected tcp socket looks like this: write(fd, "hello", 5); Sounds like you have what you want?