Commit graph

1093 commits

Author SHA1 Message Date
Andrew McCallum
642a35cd83 New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1097 72102866-910b-0410-8b05-ffd578937521
1996-03-11 20:22:20 +00:00
Andrew McCallum
ec380ef78f ([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
Andrew McCallum
e31ac21a93 ([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
Andrew McCallum
6c6372b7f1 (main): Use new notification interface.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1094 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:15:50 +00:00
Andrew McCallum
88ce6294af (announce_new_port): New function.
(announce_broken_port): New function.
(main): Register them for notifications; let user choose registered
name on command line.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1093 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:15:25 +00:00
Andrew McCallum
148267ae25 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
Andrew McCallum
e90175e3b3 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
Andrew McCallum
090baa7b50 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
Andrew McCallum
1d5160b3ca 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
Andrew McCallum
f8753a41c1 ([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
Andrew McCallum
32a702571f (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
Andrew McCallum
dde3532e32 (main): Wrap it with an NSAutoreleasePool.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1086 72102866-910b-0410-8b05-ffd578937521
1996-03-07 00:39:51 +00:00
Andrew McCallum
1b6a1efebb Update for new server interface.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1085 72102866-910b-0410-8b05-ffd578937521
1996-03-07 00:39:28 +00:00
Andrew McCallum
64d8da5a82 (main): Use new notification interface for invocations.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1084 72102866-910b-0410-8b05-ffd578937521
1996-03-07 00:36:15 +00:00
Andrew McCallum
8e27da11da 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
Andrew McCallum
b0645f6d52 (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
Andrew McCallum
489b5a0805 ([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
Andrew McCallum
e432090578 Send -close to Archiver, not old -closeCoder.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1080 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:49:39 +00:00
Andrew McCallum
a3a7a895f7 Use notifications instead of old scheme for invalidation listening.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1079 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:48:59 +00:00
Andrew McCallum
4287219162 Don't conform to no-longer-used InvalidationListening protocol.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1078 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:48:18 +00:00
Andrew McCallum
a601567d41 (announce_new_connection): New function.
(main): Register it for notifications.  Run the connection forever,
instead of on a 15 second timeout.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1077 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:47:46 +00:00
Andrew McCallum
961ca24740 (main): Before exit, invalidate the connection, not the proxy.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1076 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:46:39 +00:00
Andrew McCallum
6c665a7b9c (first): Force check for re-compilation of libobjects.
(second): Likewise.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1075 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:46:05 +00:00
Andrew McCallum
e8509b14c5 (TEXI_FILES): Add gnustep-faq.texi.
(GNUstep-FAQ): New target.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1074 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:45:35 +00:00
Andrew McCallum
ed8cc76c38 (announce_new_connection): New function.
(announce_broken_connection): New function.
(main): Register new functions for notifications.  Send messages back
to clients to test reply port mechanism.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1073 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:45:09 +00:00
Andrew McCallum
fa6177e350 Test the reply port mechanism; look for messages coming back from the
server.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1072 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:44:21 +00:00
Andrew McCallum
4cdae9b191 Use Array instead of List. Use NotificationDispatcher to hear about
invalid and new connections.  Let the user set the registerd name from
the command line.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1071 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:43:46 +00:00
Andrew McCallum
6aa03e5cd3 (main): Let user set registered name from command line.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1070 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:42:35 +00:00
Andrew McCallum
1716353d46 (SRCS): Added nsnotification.m.
(tcpport, remote): Force check of libobjects re-compilation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1069 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:42:02 +00:00
Andrew McCallum
63b4e802b0 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
Andrew McCallum
b13cd50a86 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
Andrew McCallum
e2fb754a73 (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
Andrew McCallum
e209d7cc64 (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
Andrew McCallum
d8be8f0bd5 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
Andrew McCallum
871b80f439 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
Andrew McCallum
e2b839730f 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
Andrew McCallum
7cda86ef49 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
Andrew McCallum
224b9099b9 ([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
Andrew McCallum
d37b1c5572 ([Encoder -_coderCreateReferenceForObject:]): Insert it in
object_2_xref, not const_ptr_2_xref.
([Encoder -_encodeObject:withName:isBycopy:isForwardReference:]):
Create the in_progress_table with NSNonOwnedPointerMapKeyCallBacks,
not NSObject..; needed by distributed objects so we don't get infinite
loop with proxy objects.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1059 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:09:15 +00:00
Andrew McCallum
e14e479e6b ([Decoder +readSignatureFromCStream:getClassname:formatVersion:]):
Compare got with 6, not 2.
([Decoder -_coderCreateReferenceForObject:]): Add warning comment
about a -retain we don't want.  Fix this eventually!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1058 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:07:17 +00:00
Andrew McCallum
14700c26f3 (default_in_port_class, default_out_port_class): New static variables,
replacing default_port_class.
(all_connections_local_targets): New map table; not used yet, though.
(debug_connection): Temporarily set to 1.
([Connection +initialize]): Set new static vars.
([Connection +setDefaultInPortClass:]): New method.
([Connection +defaultInPortClass]): New method.
([Connection +setDefaultOutPortClass:]): New method.
([Connection +defaultOutPortClass]): New method.
([Connection -init]): Use new default_in_port_class.
([Connection +new]): Likewise.
([Connection +newWithRootObject:]): Likewise.
([Connection +newRegisteringAtName:withRootObject:]): Likewise.
([Connection +rootProxyAtName:onHost:]): Likewise.
([Connection +rootProxyAtPort:]): Likewise.
([Connection +newForInPort:outPort:ancestorConnection:]): Assert the
in port.  Embellish the debugging message to print the in port and
out port.  Set the new connection's in port and out port ivars.
Register ourselves as observers of port invalidation with the
NotificationDispatcher.  Post a notification that a new connection was
created.
([Connection -runConnectionWithTimeout:]): Use
_serviceReceivedRequestsWithTimeout:.
([Connection -_newReceivedRmcWithTimeout:]): Use decodingClass, not
encodingClass.
([Connection -_serviceReceivedRequestsWithTimeout:]): Method name
changed from -newReceivedReplyRmcWithSequenceNumber:.
([Connection +includesLocalObject:]): New method; still needs more
infrastructure to work, though.
([Connection -inPortClass]): New method.
([Connection -outPortClass]): New method.
([Connection -setInPortClass:aPortClass]): New method.
([Connection -setOutPortClass:aPortClass]): New method.
([Connection -_encoderCreateReferenceForConstPtr:]): Add 1 to map
table count to get xref.
([Connection -_decoderCreateReferenceForConstPtr:]): Likewise.
([Connection -dealloc]): Remove ourselves from the NotificationDispatcher.
(ConnectionWasCreatedNotification): New notification string.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1057 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:05:36 +00:00
Andrew McCallum
0944e0909c (CONNECTED_CODER_FORMAT_VERSION): New macro.
([ConnectedEncoder
-_initForWritingWithConnection:sequenceNumber:identifier:]): Get
packetClass from the connection's outPort, not the outPortClass.
Return self.
([ConnectedDecoder
+readSignatureFromCStream:getClassname:formatVersion:]): Fill in name
and version.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1056 72102866-910b-0410-8b05-ffd578937521
1996-03-06 13:54:21 +00:00
Andrew McCallum
bfeb6dcb3b Use new SIGNATURE_FORMAT_STRING, as defined in objects/CoderPrivate.h.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1055 72102866-910b-0410-8b05-ffd578937521
1996-03-06 13:51:48 +00:00
Andrew McCallum
dba54a8bd3 New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1054 72102866-910b-0410-8b05-ffd578937521
1996-03-03 02:18:46 +00:00
Andrew McCallum
c86c5f3459 (GNU_MFILES): Added Notification.m and NotificationDispatcher.m.
Removed SocketPort.m.
(GNU_HEADERS): Added objects/Notification.h and
objects/NotificationDispatcher.h.  Removed objects/SocketPort.h.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1053 72102866-910b-0410-8b05-ffd578937521
1996-03-03 02:16:25 +00:00
Andrew McCallum
0410aacac3 (NSConnectionDeath): New macro.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1052 72102866-910b-0410-8b05-ffd578937521
1996-03-03 01:43:35 +00:00
Andrew McCallum
6e68375b6b New interface based on GNU Notification and NotificationDispatcher.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1051 72102866-910b-0410-8b05-ffd578937521
1996-03-03 01:41:55 +00:00
Andrew McCallum
d21e400996 New implementation based on GNU NotificationDispatcher. This version
is much faster, and has some better features.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1050 72102866-910b-0410-8b05-ffd578937521
1996-03-03 01:41:20 +00:00
Andrew McCallum
1921e871e2 New implementation based on GNU Notification. This version is much
faster, and has some better features.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1049 72102866-910b-0410-8b05-ffd578937521
1996-03-03 01:41:01 +00:00
Andrew McCallum
8d63f852b9 Declare new methods and new Notification String.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1048 72102866-910b-0410-8b05-ffd578937521
1996-03-03 01:38:40 +00:00