([ConnectedDecoder +newDecodingWithPacket:connection:]): New method.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1116 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-03-12 19:36:13 +00:00
parent 5f0b7b4d69
commit 17093e1111

View file

@ -180,6 +180,36 @@ static BOOL debug_connected_coder = NO;
return cd;
}
+ newDecodingWithPacket: (Packet*)packet
connection: (Connection*)c
{
ConnectedDecoder *cd;
id in_port;
id reply_port;
in_port = [c inPort];
/* Create the new ConnectedDecoder */
cd = [self newReadingFromStream: packet];
reply_port = [packet replyOutPort];
cd->connection = [Connection newForInPort: in_port
outPort: reply_port
ancestorConnection: c];
/* Decode the ConnectedDecoder's ivars. */
[cd decodeValueOfCType: @encode(typeof(cd->sequence_number))
at: &(cd->sequence_number)
withName: NULL];
[cd decodeValueOfCType: @encode(typeof(cd->identifier))
at: &(cd->identifier)
withName: NULL];
if (debug_connected_coder)
fprintf(stderr, "newDecoding #=%d id=%d\n",
cd->sequence_number, cd->identifier);
return cd;
}
/* Cache the const ptr's in the Connection, not separately for each