- struct sockaddr_in csa;
- int csalen;
- signed int cfd;
- (void) timer;
- cfd = accept(sockfd,(struct sockaddr*)&csa,&csalen);
- if (cfd == -1) {
- if (errno == EWOULDBLOCK) return;
- else {perror("Too bad I haven't implemented error checking yet");}
+ [timer invalidate];
+ [timer release];
+ timer = nil;
+}
+
++ (void)globalTimerFunc:(NSTimer*)timer
+{
+ [servsockets makeObjectsPerformSelector:@selector(timerFunc)];
+}
+
+- (void)timerFunc
+{
+ if (sockfd != -1)
+ {
+ struct sockaddr_in csa;
+ int csalen;
+ signed int cfd;
+ cfd = accept(sockfd,(struct sockaddr*)&csa,&csalen);
+ if (cfd == -1) {
+ if (errno == EWOULDBLOCK) ;
+ else {perror("Too bad I haven't implemented error checking yet");}