mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
(main): Run RunLoop properly according to new style.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1206 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
82c7cb714c
commit
8fb910ecf8
1 changed files with 8 additions and 4 deletions
|
@ -2,11 +2,13 @@
|
|||
#include <objects/String.h>
|
||||
#include <objects/Notification.h>
|
||||
#include <objects/Invocation.h>
|
||||
#include <objects/RunLoop.h>
|
||||
#include <Foundation/NSDate.h>
|
||||
|
||||
id announce_new_connection (id notification)
|
||||
{
|
||||
id connection = [notification object];
|
||||
#if 0
|
||||
id connection = [notification object];
|
||||
printf ("Created Connection 0x%x to %@\n",
|
||||
(unsigned)connection, [[connection outPort] description]);
|
||||
#endif
|
||||
|
@ -63,10 +65,12 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
/* Run, exiting as soon as there are 15 seconds with no requests */
|
||||
[[server connectionForProxy] runConnectionWithTimeout: -1];
|
||||
/* Run, exiting as soon as there are 30 minutes with no requests */
|
||||
[RunLoop runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 30 * 60]];
|
||||
|
||||
/* Clean up, to let the server know we're going away */
|
||||
/* Clean up, to let the server know we're going away; (although
|
||||
this isn't strictly necessary because the remote port will
|
||||
detect that the connection has been severed). */
|
||||
[[server connectionForProxy] invalidate];
|
||||
|
||||
exit(0);
|
||||
|
|
Loading…
Reference in a new issue