Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Net.WaitForConnection freezes the program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue May 27, 2003 9:39 pm   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Tue May 27, 2003 9:43 pm   Post subject: (No subject)

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




PostPosted: Tue May 27, 2003 9:46 pm   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: