This is TMConnectionRunner.h in view mode; [Download] [Up]
/* Interface to TMConnectionRunner class. Written by Tiggr <tiggr@es.ele.tue.nl> and Michael <michael@thi.nl> Copyright (C) 1994, 1995 Pieter J. Schoenmakers and Michael L.H. Brouwer. All rights reserved. This file is part of RUNNER. RUNNER is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. RUNNER is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with RUNNER; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. $Id: TMConnectionRunner.h,v 1.2 1995/11/29 17:40:51 tiggr Exp $ */ #import "TMConnectionObserver.h" #import <dpsclient/dpsNeXT.h> /* Revamps of the well-known dpsclient port functions. The PRIORITY is ignored, as is the MAX_SIZE. For all DPS* functions, a connection runner must have been allocated for the call to have any effect. */ void DPSAddPort (port_t new_port, DPSPortProc handler, int max_size, void *user_data, int priority); void DPSRemovePort(port_t port); /* Revamps of the well-known dpsclient timed entry functions. The PRIORITY is ignored. */ DPSTimedEntry DPSAddTimedEntry (double period, DPSTimedEntryProc handler, void *user_data, int priority); void DPSRemoveTimedEntry (DPSTimedEntry te); /* Start a timeout on the reception of a message on the registered PORT for TIMEOUT milliseconds. Iff the intvalue of TIMEOUT is -1, the default timeout for this port is used. */ void DPSStartTimeout (port_t port, int timeout); /* Cancel a previously started timeout (which is also done upon reception of a message within the timeout value). */ void DPSCancelTimeout (port_t port); @class HashTable; @interface TMConnectionRunner: TMConnectionObserver { /* The set on which we listen. */ port_t set; /* The hashtable for the monitored ports. */ HashTable *ports; /* The head and tail of the timeout delta. */ struct dps_registered_port *timeout_head, **timeout_tail; } /* Return the shared instance of the connection runner. This is the designated and only allowed way to obtain a `new' connection runner. */ +(TMConnectionRunner *) sharedRunner; /* Run the loop, never returning. */ -(void) run; /******************** port manipulation ********************/ /* Add the PORT to the set of monitored ports, invoking HANDLER with the incoming message and the DATA if a message arrives on this port. TIMEOUT is the default timeout (in milliseconds). */ -(void) addPort: (port_t) port handler: (DPSPortProc) handler data: (void *) data timeout: (int) timeout; /* Remove the PORT from the set of monitored ports. */ -(void) removePort: (port_t) port; /******************** timed entries ********************/ /* Create a new timed entry for the indicated PERIOD (in milliseconds) with the HANDLER and the USER_DATA. Return its handle. */ -(DPSTimedEntry) addTimedEntry: (int) period handler: (DPSTimedEntryProc) handler data: (void *) user_data; /* Remove the timed entry TE. */ -(void) removeTimedEntry: (DPSTimedEntry) te; /******************** timeouts ********************/ /* Cancel a previously started timeout. */ -(void) cancelTimeout: (port_t) port; /* Start a timeout on the reception of a message on the registered PORT for the default timeout. If within the timeout a message is not received, the handler is invoked with a NULL message. */ -(void) startTimeout: (port_t) port; /* Start a timeout on the reception of a message on the registered PORT for the specified TIMEOUT milliseconds. */ -(void) startTimeout: (port_t) port timeout: (int) timeout; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.