Commit graph

720 commits

Author SHA1 Message Date
mccallum
addfc7456e ([NSGSet -member:]): Return value.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1133 72102866-910b-0410-8b05-ffd578937521
1996-03-13 02:34:37 +00:00
mccallum
88cb4347f5 ([ConstantIndexedCollection -firstObject]): Return nil if emtpy.
([ConstantIndexedCollection -lastObject]): Likewise.
([ConstantIndexedCollection -prevObjectWithEnumState:]): Use -1 to
deal with reversals at extremes.
([ConstantIndexedCollection -nextObjectWithEnumState:]): Use [self
count] to deal with reversals at extremes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1132 72102866-910b-0410-8b05-ffd578937521
1996-03-13 02:34:22 +00:00
mccallum
3e003b0db1 (in_port_2_ancestor): New static variable.
([Connection +initialize]): Initialize it.
([Connection +newForInPort:outPort:ancestorConnection:]): Use new
static variable to handle ancestor; (ignore ancestor argument; the
method name will be changed later).  Set the in-port's packet
invocation to the Connection class. Don't call -addToRunLoop.. here,
the mechanics of it were already done above.
([Connection -addToRunLoop:forMode:]): Mark it as not implemented, for
now.
([Connection -runConnectionUntilDate:]): Don't add to run loop here.
([Connection +invokeWithObject:]): Make it a class method instead of
an instance method; alter contents appropriately for this.
([Connection -portIsInvalid:]): Look at in_port_2_ancestor and remove
ourselves if necessary.
([Connection -invalidate]): Don't remove ourselves from the run loop
here, because we may not be the only one listening.  This still needs
fixing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1131 72102866-910b-0410-8b05-ffd578937521
1996-03-13 02:32:46 +00:00
mccallum
947465458a ([ConnectedEncoder -dismiss]): Fix typo in sendPacket: call.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1130 72102866-910b-0410-8b05-ffd578937521
1996-03-13 02:26:24 +00:00
mccallum
72ac85de5c Several minor fixes to return types and return values.
([ReverseEnumerator -nextObject]): Pass pointer to enum_state.
([ConstantIndexedCollection -prevObjectWithEnumState:]): Method
overhauled.
([ConstantIndexedCollection -nextObjectWithEnumState:]): Likewise.
([ConstantIndexedCollection -newEnumState]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1129 72102866-910b-0410-8b05-ffd578937521
1996-03-12 20:39:58 +00:00
mccallum
659c2fa200 Remove #include of objects/eltfuncs.h.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1126 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:48:47 +00:00
mccallum
64b554fab2 Remove #include of objects/collhash.h.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1125 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:48:05 +00:00
mccallum
e97e90fc13 Declare new methods and classes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1124 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:45:24 +00:00
mccallum
e378e2025b Declare new method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1123 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:45:11 +00:00
mccallum
bfacad8920 Declare new methods. Type arguments with InPort and OutPort, not just
Port.
(Connection reply_depth): New ivar.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1122 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:44:34 +00:00
mccallum
14e9a570a6 Updated to conform to new Port class. TcpPacket class split into
TcpInPacket and TcpOutPacket.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1121 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:43:25 +00:00
mccallum
9065b24e37 Debugging messages conditioned on debug_run_loop.
([RunLoop -runOnceBeforeDate:forMode:]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1120 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:42:45 +00:00
mccallum
5e4ad23b78 ([Port +outPacketClass]): Method renamed from packetClass.
([Port -outPacketClass]): Likewise.
([InPort -setReceivedPacketInvocation:]): Method renamed from
setPacketInvocation.
([OutPort -sendPacket:]): Method renamed from -sendPacket:withTimeout:.
(OutPacket, InPacket): New classes, replacing Packet class.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1119 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:42:10 +00:00
mccallum
1edac6f126 ([MemoryStream -initWithCapacity:prefix:]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1118 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:40:30 +00:00
mccallum
a4b570cbf2 Remove old-style methods for getting incoming ConnectedCoders. Add
new methods that use RunLoop.  All callers changed.
([Connection -addToRunLoop:forMode:]): New method.
([Connection -removeFromRunLoop:forMode:]): New method.
([Connection -runConnectionUntilDate:]): New method.
([Connection -runConnection]): Method changed to call above method.
([Connection -_handleRmc:]): New method.
([Connection -_handleQueuedRmcRequests]): New method.
([Connection -_getReceivedReplyRmcFromQueueWithSequenceNumber:]): New
method.
([Connection -_getReceivedReplyRmcWithSequenceNumber:]): New method.
([Connection -invokeWithObject:]): New method.
([Connection +newForInPort:outPort:ancestorConnection:]): Set
reply_depth ivar.
([Connection -_encoderCreateReferenceForConstPtr:]): Return the xref!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1117 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:40:16 +00:00
mccallum
02c5d2f22a ([ConnectedDecoder +newDecodingWithPacket:connection:]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1116 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:36:13 +00:00
mccallum
e8d8fc9588 *** empty log message ***
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1114 72102866-910b-0410-8b05-ffd578937521
1996-03-12 15:39:13 +00:00
mccallum
d2e640c43b (TcpInPort _run_loop, _run_loop_mode): New ivars.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1113 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:57:08 +00:00
mccallum
0b83e5b725 Declare new methods.
(Port _packet_invocation): New ivar.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1112 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:56:43 +00:00
mccallum
02e6ab2701 ([NotificationDispatcher +defaultInstance): Declare new method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1111 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:55:49 +00:00
mccallum
153b84d956 (Notifying): New protocol.
(NotificationPosting): New protocol.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1110 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:55:22 +00:00
mccallum
0b0329b2f6 Declare new method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1109 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:54:34 +00:00
mccallum
437913db94 (ConstantArray): Inherit from ConstantIndexedCollection, not
IndexedCollection.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1108 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:54:25 +00:00
mccallum
a61ae3ccbf ([TcpInPort -receivePacketWithTimeout:]): Completely new
implementation that uses the RunLoop.
([TcpInPort -old_receivePacketWithTimeout:]): New method, holding old
implementation.
([TcpInPort -invokeWithObject:]): New method, called by RunLoop.
([TcpInPort -_tryToGetPacketFromReadableFD:]): New private method.
([TcpInPort -_addClientOutPort:toRunLoop:forMode:]): New method.
([TcpInPort -addToRunLoop:forMode:]): New method.
([TcpInPort -_removeClientOutPort:fromRunLoop:forMode:]): New method.
([TcpInPort -removeFromRunLoop:forMode:]): New method.
([TcpInPort -_addClientOutPort:]): Add it to the RunLoop.
([TcpInPort -_connectedOutPortInvalidated:]): Remove it from the
RunLoop.
([TcpInPort -_addClientOutPort:]): Method renamed from _addOutPort:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1107 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:53:45 +00:00
mccallum
36e7676707 ([InPort -init]): Set _packet_invocation.
([InPort -setPacketInvocation:]): New method.
([InPort -addToRunLoop:forMode:]): New method.
([InPort -removeFromRunLoop:forMode:]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1106 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:50:46 +00:00
mccallum
da4a4ccfe8 ([NotificationDispatcher +defaultInstance]): New method.
([NotificationDispatcher -removeObserver:name:object:]): Remove
handling of non-existance _nil_observer_array.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1105 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:49:02 +00:00
mccallum
c014b911a5 Many small formatting changes.
(UNIX_REFERENCE_INTERVAL): Macro renamed from UNIX_OFFSET.
([NSConcreteDate -timeIntervalSinceNow]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1104 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:48:07 +00:00
mccallum
18597e28ae (CFLAGS): Add -Wall.
(GNU_MFILES): Add RunLoop.m.
(GNU_HEADERS): Add objects/RunLoop.h.
(GNUSTEP_MFILES): Add NSTimer.m.
(GNUSTEP_HEADERS): Add Foundation/NSTimer.h.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1103 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:46:20 +00:00
mccallum
dbd61108e4 (return_retained): Change macro from 1 to 0.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1102 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:44:47 +00:00
mccallum
ce9937212b ([Connection -isValid]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1099 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:43:30 +00:00
mccallum
d790110e2e ([IndexedCollection +initialize]): Compare self with
IndexedCollection, not KeyedCollection.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1096 72102866-910b-0410-8b05-ffd578937521
1996-03-11 17:02:02 +00:00
mccallum
0f270ba791 ([TcpInPort -receivePacketWithTimeout:]): Move initialization of
select_timeout to inside loop since Linux select() modifies
*select_timeout.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1095 72102866-910b-0410-8b05-ffd578937521
1996-03-07 20:51:50 +00:00
mccallum
c1e75d3b05 Fix typo.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1092 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:14:41 +00:00
mccallum
4e48eb0082 Assert is_valid in many places.
([TcpInPort +newForReceivingFromPortNumber:]): Get the address of the
host, not localhost=127.0.0.1.
([TcpInPort -invalidate]): Remove ourselves from socket_2_port and
port_number_2_port here instead of in -dealloc.
([TcpInPort -description]): Indicate whether we are valid or not in
string.
([TcpOutPort -description]): Likewise.
([TcpOutPort -invalidate]): Assert is_valid, don't just conditionally
execute body.  Remove ourselves from out_port_bag and socket_2_port
here, not in -dealloc.
([TcpPacket +_getPacketSize:andReplyPort:fromSocket:inPort:]): If we
don't read() full prefix, don't abort(), just return EOF.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1091 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:14:23 +00:00
mccallum
f6d5c1c787 Assert that the connection is valid in several places.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1090 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:09:06 +00:00
mccallum
c2cf958548 Assert is_valid in many places.
([Connection +newForInPort:outPort:ancestorConnection:]): Set is_valid
to 1.  Only ask for notification of out port death if out port is non-nil.
([Connection -portIsInvalid:]): Properly get the port from the
notification object.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1089 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:08:24 +00:00
mccallum
0e774391ed ([Port -invalidate]): Insist that is_valid is true at the beginning of
this method, don't test it and skip the body of this method.  Force
users to be careful about calling -invalidate more than once.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1088 72102866-910b-0410-8b05-ffd578937521
1996-03-07 02:30:04 +00:00
mccallum
c6a9cf83d8 (NSAllMapTableValues): Get rid of unused variable ARRAY. Return
VALUEARRAY, not unused variable.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1087 72102866-910b-0410-8b05-ffd578937521
1996-03-07 01:56:10 +00:00
mccallum
173ead75cb Declare new methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1083 72102866-910b-0410-8b05-ffd578937521
1996-03-07 00:29:05 +00:00
mccallum
599b54b504 (NotificationRequest): Ivar names prepended with `_'.
(NotificationInvocation): Likewise.
(NotificationPerformer): Likewise.
([NotificationDispatcher
-_addObserver:notificationRequest:name:object:]): Insist that observer
be non-nil; (in the case of Invocation's, the invocation is now the
observer).
([NotificationDispatcher -addInvocation:name:object:]): Method renamed
from -addObserver:invocation:...  Pass the invocation as the
observer.  Release the NR after it has been added.
([NotificationDispatcher -addObserver:selector:name:object:]): Release
the NR after it has been added.
([NotificationDispatcher -_removeFromLinkedListNotificationRequest:]):
New method.
([NotificationDispatcher -removeInvocation:]): New method.
([NotificationDispatcher -removeInvocation:name:object:]): New method.
([NotificationDispatcher -removeObserver:]): Use
_removeFromLinkedListNotificationRequest:.
([NotificationDispatcher -removeObserver:name:object:]): Likewise.
([NotificationDispatcher +addInvocation:name:object:]): New method.
([NotificationDispatcher +removeInvocation:]): New method.
([NotificationDispatcher +removeInvocation:name:object:]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1082 72102866-910b-0410-8b05-ffd578937521
1996-03-07 00:28:43 +00:00
mccallum
fd0733d23d ([Connection +initialize]): Initialize all_connections_local_targets.
([Connection -addLocalObject:]): Put it in all_connections_local_targets
also.
([Connection -removeLocalObject:]): Remove it from
all_connections_local_targets also.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1081 72102866-910b-0410-8b05-ffd578937521
1996-03-06 16:40:00 +00:00
mccallum
741a48d406 Declare new ivars and notfication strings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1068 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:38:38 +00:00
mccallum
beace25ae7 Several ivar name changes. Method types fixed.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1067 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:38:13 +00:00
mccallum
efb18c71e7 (in_port_class, out_port_class): New ivars replacing port_class.
Declare methods to get and set them.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1066 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:37:45 +00:00
mccallum
d7c22f7452 (SIGNATURE_FORMAT_STRING): Remove "version" from between class name
and format version.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1065 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:37:11 +00:00
mccallum
16cb7de5b3 Fix typos.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1064 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:36:36 +00:00
mccallum
ed0c23d9a9 Many ivar names changed for clarity. Some new ivars added; see
changes to TcpPort.h.  Overhaul of how TcpOutPort's track their remote
address.  Previously they used the address of their local peer; this
is no good when encoding a TcpOutPort on the wire for D.O.; the
D.O. reciever needs a way to contact the listen'ing socket of the
TcpInPort in order to form a new connection.  _remote_in_port_address
is now the address of the remote listen'ing socket.  Added many
comments throughout.  All perror() calls changes to be more
informative.
(debug_tcp_port): Make this a static variable instead of a macro.
(init_socket_2_port): Check pre-existance of socket_2_port here
instead of callers.
([TcpInPort +newForReceivingFromPortNumber:]): Method overhauled.
Don't bind socket to INADDR_ANY because we need to be able to encode
our unique host address on the wire for D.O.
([TcpInPort -_listeningSockaddr]): New method.
([TcpInPort -receivePacketWithTimeout:]): Method overhauled.  Get the
reply port for an incoming packet from the packet prefix.
([TcpInPort -_connectedOutPortInvalidated:]): Add debugging message.
([TcpInPort -classForConnectedCoder:]): Return the TcpOutPort class,
not [self class] because we always encode a "send right" (ala Mach),
not a "recieve right".
([TcpOutPort
+newForSendingToSockaddr:withAcceptedSocket:pollingInPort:]): Method
renamed, and majorly overhauled.  Now many different combinations of
NULL argument do different things.  This is now the single designated
initializer.  We now check both the SOCKADDR and the SOCK argument to
find previously-created TcpOutPort's.  This method is also used to set
the remote_in_port_address of an already-created TcpOutPort.  There is
more error checking.
([TcpOutPort +newForSendingToPortNumber:onHost:]): Overhauled.
([TcpOutPort +_newWithAcceptedSocket:peeraddr:inPort:]): Overhauled to
work with new designated  initalizer.
([TcpOutPort -sendPacket:withTimeout:]): Use new low-level Packet
interface that deals with reply ports.
([TcpOutPort +packetClass]): New method.
(PREFIX_LENGTH_TYPE): New macro.
(PREFIX_LENGTH_SIZE): New macro.
(PREFIX_ADDRESS_TYPE): New macro.
(PREFIX_ADDRESS_SIZE): New macro.
(PREFIX_SIZE): New macro.
([TcpPacket -_initForReceivingWithSize:replyPort:]): Use 0 prefix,
because the separate +_getPacketSize... method reads those bytes.
([TcpPacket -_writeToSocket:withReplySockaddr:]): Now the prefix
includes the sockaddr of the reply port.  If ADDR is non-null, set the
reply port address portion of the prefix.
([TcpPacket +_getPacketSize:andReplyPort:fromSocket:inPort:]): New
method, replacing +readPacketSizeFromSocket:.
([TcpPacket -_fillFromSocket:]): Set Stream's eofPosition properly.
Leave Stream's position at zero.
(InPortAcceptedClientNotification): New notification string.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1063 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:35:57 +00:00
mccallum
af321f2af1 Change many ivar names.
(debug_proxy): Temporarily set to 1.
([Proxy +newForRemoteTarget:connection:]): Set new ivar names.
Embellish debugging message to include connection.
([Proxy -invalidateProxy]): Return void instead of self.
([Proxy +encodeObject:withConnectedCoder:]): Overhauled, encode tag,
and change order of encoding for more efficient encoding.  Added many
comments.
([Proxy +newWithCoder:]): Likewise, to match.  Also added a check to
make sure we don't return a bogus pointer for a local object; do this
by checking with connection's +includesLocalObject; if it's not
there, raise an exception.
([Proxy -forward::]): Call the new forwarding method name in Connection.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1062 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:16:04 +00:00
mccallum
d2c356a762 Indentation changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1061 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:10:17 +00:00
mccallum
34a7788ce2 ([LinkedList -prependObject:]): Fix return type.
([LinkedList -insertObject:atIndex:]): Likewise.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1060 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:09:55 +00:00