mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
([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:
parent
5f0b7b4d69
commit
17093e1111
1 changed files with 30 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue