I just have started studying perl and I can not figure out what is the exact strategy used in the following script to handle events.
Precisely, what I do not understand is if the loop that is in charge to control the state of the socket, is managed at the system level (where the process will be locked inside the scheduler and so the following code must be read sequentially) or if this happens anywhere else, or maybe just in these "while loop" that apparently are based on the success of the setting of a variable.
Especially the "while" block at the server-side leaves me some concern.
Script to Create a Server
$perl sever.pl&
Script to Create a Client
Thanks for any answare!
accept() will block at the kernel level, yes. It will be forced to wait until the client connects.
It's not based on the success of setting a variable. It does the same thing as while(accept(...)) without the assignment -- but the program needs the value accept is returning, so it's saved for later.
hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view
situation
a router, with linux of some sort,
dhcp client requesting for ip in wan1 (as usual with wan ports)
dhcp server listening in lan1, and assigning ip (as usual... (9 Replies)
After an extensive search, I haven't found a definitive answer to my question. "And what is your question you frackking noob", you may ask. Ok, here goes: When using sigwait to wait for SIGUSR1 or SIGUSR2, can you have it trigger a signal handler? The following code did NOT, and the example I got... (2 Replies)