Computer Science Canada

Net.WaitForConnection freezes the program

Author:  Homer_simpson [ Tue May 27, 2003 9:27 pm ]
Post subject:  Net.WaitForConnection freezes the program

Net.WaitForConnection freezes the program until a connection has been established is there anyway to avoid that...?
perhaps using process and fork?

Author:  Tony [ Tue May 27, 2003 9:39 pm ]
Post subject: 

yes, you could have it running in a process in the background, and once new connection is made, call the procedure to add user to the chat and do w/e else you need.

Author:  Homer_simpson [ Tue May 27, 2003 9:43 pm ]
Post subject: 

I really suck at processes and fork could u explain how process and fork work?!

Author:  Tony [ Tue May 27, 2003 9:46 pm ]
Post subject: 

code:

process waiting
loop
Net.WaitForConnection
end loop
end waiting

fork waiting

loop
put "this is main loop
end loop


This will basically randomly pick the procedure from which to execute a line between the process and your main loop.

something like

process
main
process
process
main
process
main
main
process
main

Its random and still 1 line at a time, not at same time... just to let you know.


: