mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
774c3ef6dd
commit
02c5d2f22a
1 changed files with 30 additions and 0 deletions
|
@ -180,6 +180,36 @@ static BOOL debug_connected_coder = NO;
|
||||||
return cd;
|
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
|
/* Cache the const ptr's in the Connection, not separately for each
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue