mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
([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
This commit is contained in:
parent
1edac6f126
commit
5e4ad23b78
1 changed files with 53 additions and 14 deletions
|
@ -73,7 +73,13 @@
|
||||||
is_valid = NO;
|
is_valid = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (Class) packetClass
|
+ (Class) outPacketClass
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (Class) outPacketClass
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -128,7 +134,7 @@
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setPacketInvocation: (id <Invoking>)invocation
|
- (void) setReceivedPacketInvocation: (id <Invoking>)invocation
|
||||||
{
|
{
|
||||||
_packet_invocation = invocation;
|
_packet_invocation = invocation;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +161,7 @@
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) sendPacket: packet withTimeout: (int)milliseconds
|
- (BOOL) sendPacket: packet
|
||||||
{
|
{
|
||||||
[self subclassResponsibility:_cmd];
|
[self subclassResponsibility:_cmd];
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -164,23 +170,56 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation Packet
|
@implementation InPacket
|
||||||
|
|
||||||
/* xxx There should be a designated initializer for the Packet class.
|
/* The designated initializer. */
|
||||||
Currently some subclasses and users, bypass this by calling
|
- initForReceivingWithCapacity: (unsigned)c
|
||||||
MemoryStream initializers. */
|
receivingInPort: ip
|
||||||
|
replyOutPort: op
|
||||||
- initForSendingWithCapacity: (unsigned)c
|
|
||||||
replyPort: p
|
|
||||||
{
|
{
|
||||||
[super initWithCapacity: c];
|
[super initWithCapacity: c
|
||||||
reply_port = p;
|
prefix: 0];
|
||||||
|
assert ([op isValid]);
|
||||||
|
assert (!ip || [ip isValid]);
|
||||||
|
_reply_out_port = op;
|
||||||
|
_receiving_in_port = ip;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- replyPort
|
- replyOutPort
|
||||||
{
|
{
|
||||||
return reply_port;
|
return _reply_out_port;
|
||||||
|
}
|
||||||
|
|
||||||
|
- receivingInPort
|
||||||
|
{
|
||||||
|
return _receiving_in_port;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation OutPacket
|
||||||
|
|
||||||
|
/* The designated initializer. */
|
||||||
|
- initForSendingWithCapacity: (unsigned)c
|
||||||
|
replyInPort: ip
|
||||||
|
{
|
||||||
|
[super initWithCapacity: c
|
||||||
|
prefix: [[self class] prefixSize]];
|
||||||
|
assert ([ip isValid]);
|
||||||
|
_reply_in_port = ip;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (unsigned) prefixSize
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- replyInPort
|
||||||
|
{
|
||||||
|
return _reply_in_port;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue