TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: DENNIS LEE BIEBER
date: 2020-06-29 15:29:00
subject: Re: Using an RPi 3B+ as a

On Mon, 29 Jun 2020 10:14:09 +0200, "R.Wieser" 
declaimed the following:

>
>Not quite.   My basic idea was/is to have the Pi to respond to a connect
>request on a single port only, and than, when both sides have connected
>(their actions, not the Pi's), transfer datapackets from one interface
>(socket) to the other.
>

 Which implies you have defined a protocol and CLIENT programs running
on the "sides" to talk to that port. The R-Pi is listening for connections
-- making it a /server/ application. The "sides" need to have client
applications that ask for that port. Client programs that use other ports
won't connect -- so you can't use the R-Pi to, say, tunnel TELNET from one
"side" to the other "side" as TELNET uses port 23 as the server side.

https://www.man7.org/linux/man-pages/man2/listen.2.html
https://www.man7.org/linux/man-pages/man2/accept.2.html

 The R-Pi would have to be listening for any connection requests on the
known port -- but likely from any interface. You then accept that
connection which creates a new socket with R-Pi and "other" end-points. You
also need to multi-thread passing that new socket off so the main server
can go back and process the next listen/accept sequence. But now you have
two sockets (and if you are listening on "any" interface, both accepts
could be to the same "other", just with different end-point port numbers).
How you identify that these two accepted sockets are supposed to be
forwarding packet data between each is something you will have to write.

 The whole TCP/IP system is based around one (client) side initiating
connections all the way through to the remote (server) side (and servers
that spawn threads for each connection in order to allow them to go back
and accept more connections)..


--
 Wulfraed                 Dennis Lee Bieber         AF6VN
 wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.