1
/* NSPortMessage interface for GNUstep
2
Copyright (C) 1998 Free Software Foundation, Inc.
4
Written by: Richard frith-Macdonald <richard@brainstorm.co.Ik>
7
This file is part of the GNUstep Base Library.
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Library General Public
11
License as published by the Free Software Foundation; either
12
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public
20
License along with this library; if not, write to the Free
21
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
24
#ifndef __NSPortMessage_h_GNUSTEP_BASE_INCLUDE
25
#define __NSPortMessage_h_GNUSTEP_BASE_INCLUDE
27
#include <Foundation/NSArray.h>
28
#include <Foundation/NSPort.h>
31
* <p>The data transported for distributed objects communications is sent over
32
* the network encapsulated by NSPortMessage objects, which consist of two
33
* [NSPort]s (sender and receiver, not sent over the network) and a body
34
* consisting of one or more [NSData] or [NSPort] objects. (Data in the
35
* [NSData] must be in network byte order.)</p>
37
* <p>See the [NSConnection] and [NSPortCoder] classes.</p>
39
@interface NSPortMessage : NSObject
44
NSMutableArray *_components;
47
* OpenStep compatibility.
49
- (id) initWithMachMessage: (void*)buffer;
51
/** <init/> Initializes to send message described by items (which should
52
* contain only [NSPort] and/or [NSData] objects, with contents in network
53
* byte order) over aPort. If/when a reply to the message is sent, it will
54
* arrive on anotherPort.
56
- (id) initWithSendPort: (NSPort*)aPort
57
receivePort: (NSPort*)anotherPort
58
components: (NSArray*)items;
61
* Request that the message be sent before when. Will block until either
62
* sends it (returns YES) or when expires (returns NO). The latter may occur
63
* if many messages are queued up (by multiple threads) faster than they can
64
* be sent over the network.
66
- (BOOL) sendBeforeDate: (NSDate*)when;
69
* Returns the message components originally used to constitute this message.
71
- (NSArray*) components;
74
* For an outgoing message, returns the port the receiver will send itself
75
* through. For an incoming message, returns the port replies to the receiver
76
* should be sent through.
81
* For an outgoing message, returns the port on which a reply to this message
82
* will arrive. For an incoming message, returns the port this message
85
- (NSPort*) receivePort;
88
* Sets ID for message. This is not used by the distributed objects system,
89
* but may be used in custom ways by cooperating applications to sort or
90
* otherwise organize messages.
92
- (void) setMsgid: (unsigned)anId;
95
* Returns ID for message. This is not used by the distributed objects
96
* system, but may be used in custom ways by cooperating applications to sort
97
* or otherwise organize messages. Set to 0 initially.
103
@interface NSPortMessage (private)
104
- (NSMutableArray*) _components;