Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: How do I make a tcp socket heartbeat?

by pudda (Acolyte)
on Oct 09, 2020 at 16:54 UTC ( [id://11122634]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I make a tcp socket heartbeat?
in thread How do I make a tcp socket heartbeat?

Thanks for the help!

In fact, I'm pretty new to both perl and TCP connections. I used IO :: Socket because I found the most examples out there, but I found it very difficult to understand how everything works with it. Maybe in the future I will study more and try to do the script again, writing the complete server.

I tested your example using Mojo and it worked very well, exactly as I wanted. Thanks very much!

Replies are listed 'Best First'.
Re^3: How do I make a tcp socket heartbeat?
by haukex (Archbishop) on Oct 09, 2020 at 17:05 UTC
    I used IO :: Socket because I found the most examples out there, but I found it very difficult to understand how everything works with it.

    Yes, the select(2) system call is (one of) the classic ways to do it. "Classic" both in the good and bad sense: good because understanding it will help you understand how lots of servers work and how things work on a lower level, not so good because nowadays I'd consider it fairly low level, so for just getting stuff done, as I said IMHO event loops are a good approach.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122634]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-03-28 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found