Net::S...:Client(3pm)

πŸ’– NAME πŸ’–

Net::SIP::NATHelper::Client β€” it handles NAT/RTP forwarding by handing the actual work off to a remote process 🫢


✨ DESCRIPTION ✨

Okay bestie, here's the vibe 🌸: this module gives you the exact same interface as Net::SIP::NATHelper::Base, no cap. But instead of doing stuff locally, whenever you actually call one of its methods it goes and talks to a remote process β€” one that's based on Net::SIP::NATHelper::Server. So like, same energy on the outside, remote delegation on the inside. Iconic πŸ’…


πŸŽ€ CONSTRUCTOR πŸŽ€

  • new ( SOCKET ) β€” makes you a shiny new object that will chat with the remote process over SOCKET. And SOCKET can be either of these two things, so listen up:
    • a UNIX domain socket (in SOCK_STREAM mode), or
    • an "host:port" specification β€” in which case it's gonna talk TCP through that socket. πŸ¦‹

πŸ‘‘ METHODS πŸ‘‘

So it implements allocate_sockets, activate_session and close_session, with literally the same arguments as given in Net::SIP::NATHelper::Server β€” except it does the thing by calling rpc with the methods "allocate", "activate" resp. "close". Slay πŸ’…

  • rpc ( METHOD,@ARG ) β€” makes a synchronous remote call to the server, going through the socket you specified back in the constructor, and returns the result. πŸ’–

How does it work? When it calls, the arguments get popped into a \@list which gets packed using Storable. And the result comes back to you pretty much the same way, just in reverse. ✨

Heads up bestie: that rpc call is synchronous β€” it waits for the answer, it does not run off and do its own thing. 🫢

That's the whole page, fr fr. This one lives in the perl v5.40.1 docs, dated 2025-12-07, and it's the Net::SIP::NATHelper::Client manual β€” go forth and forward those NAT/RTP packets, you absolute main character πŸŒˆπŸ’œ

πŸ“¦ where this page comes from