I need some help from your church in relation to socket data manipulation.
I've made a deamon that accept conections always from the same machine (HOST1), processes the data recieved and send SNMP traps to another machine (HOST2).
The problem is that I wrote it assuming that each time HOST1 has something to send it will connect send data and disconnect, but yesterday I learned we shouldn't make that kind of assumptions...
while (defined(my $line = <$NA_Conn>)) { $input.=$line; } #processing the $input here...
So, HOST1 never disconects, it connects to my deamon and whenever it has data to send it send's... But this way the $input is never processed.
What is the best way to process the input in 'real time'?
TIP: I need to send a trap each time I get a complete 'packet' with start and end flags: #S#\n\r<lines of data here >\n\r#E#
Threads? Multiprocess? Something simpler and effective?
PS: I would prefer stability to velocity.
Thanks in advance, AMEN Monks!
In reply to Real-time socket data processing by psyk0tic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |