2 * DEBUG: section 77 Delay Pools
3 * AUTHOR: Robert Collins <robertc@squid-cache.org>
4 * Based upon original delay pools code by
5 * David Luyer <david@luyer.net>
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
10 * Squid is the result of efforts by numerous individuals from
11 * the Internet community; see the CONTRIBUTORS file for full
12 * details. Many organizations have provided support for Squid's
13 * development; see the SPONSORS file for full details. Squid is
14 * Copyrighted (C) 2001 by the Regents of the University of
15 * California; see the COPYRIGHT file for full details. Squid
16 * incorporates software developed and/or copyrighted by other
17 * sources; see the CREDITS file for full details.
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
38 \defgroup DelayPoolsInternal Delay Pools Internal
39 \ingroup DelayPoolsAPI
46 #include "CacheManager.h"
47 #include "DelaySpec.h"
48 #include "DelayPools.h"
50 #include "StoreClient.h"
52 #include "MemObject.h"
53 #include "client_side_request.h"
54 #include "ConfigParser.h"
57 #include "SquidString.h"
58 #include "SquidTime.h"
59 #include "CommonPool.h"
60 #include "CompositePoolNode.h"
61 #include "DelayPool.h"
62 #include "DelayVector.h"
63 #include "NullDelayId.h"
64 #include "DelayBucket.h"
65 #include "DelayUser.h"
66 #include "DelayTagged.h"
67 #include "ip/IpAddress.h"
69 /// \ingroup DelayPoolsInternal
70 long DelayPools::MemoryUsed
= 0;
72 /// \ingroup DelayPoolsInternal
73 class Aggregate
: public CompositePoolNode
77 typedef RefCount
<Aggregate
> Pointer
;
78 void *operator new(size_t);
79 void operator delete (void *);
82 virtual DelaySpec
*rate() {return &spec
;}
84 virtual DelaySpec
const *rate() const {return &spec
;}
86 virtual void stats(StoreEntry
* sentry
);
87 virtual void dump(StoreEntry
*entry
) const;
88 virtual void update(int incr
);
91 virtual DelayIdComposite::Pointer
id(CompositeSelectionDetails
&);
95 /// \ingroup DelayPoolsInternal
96 class AggregateId
:public DelayIdComposite
100 void *operator new(size_t);
101 void operator delete (void *);
102 AggregateId (RefCount
<Aggregate
>);
103 virtual int bytesWanted (int min
, int max
) const;
104 virtual void bytesIn(int qty
);
105 virtual void delayRead(DeferredRead
const &);
108 RefCount
<Aggregate
> theAggregate
;
111 friend class AggregateId
;
113 DelayBucket theBucket
;
117 /// \ingroup DelayPoolsInternal
118 template <class Key
, class Value
>
124 unsigned int size() const;
125 unsigned char findKeyIndex (Key
const key
) const;
126 bool indexUsed (unsigned char const index
) const;
127 unsigned int insert (Key
const key
);
129 #define IND_MAP_SZ 256
131 Key key_map
[IND_MAP_SZ
];
132 Value values
[IND_MAP_SZ
];
135 unsigned int nextMapPosition
;
138 /// \ingroup DelayPoolsInternal
139 class VectorPool
: public CompositePoolNode
143 typedef RefCount
<VectorPool
> Pointer
;
144 virtual void dump(StoreEntry
*entry
) const;
145 virtual void parse();
146 virtual void update(int incr
);
147 virtual void stats(StoreEntry
* sentry
);
149 virtual DelayIdComposite::Pointer
id(CompositeSelectionDetails
&);
150 VectorMap
<unsigned char, DelayBucket
> buckets
;
155 bool keyAllocated (unsigned char const key
) const;
156 virtual DelaySpec
*rate() {return &spec
;}
158 virtual DelaySpec
const *rate() const {return &spec
;}
160 virtual char const *label() const = 0;
162 virtual unsigned int makeKey (IpAddress
&src_addr
) const = 0;
166 /// \ingroup DelayPoolsInternal
167 class Id
:public DelayIdComposite
171 void *operator new(size_t);
172 void operator delete (void *);
173 Id (RefCount
<VectorPool
>, int);
174 virtual int bytesWanted (int min
, int max
) const;
175 virtual void bytesIn(int qty
);
178 RefCount
<VectorPool
> theVector
;
183 /// \ingroup DelayPoolsInternal
184 class IndividualPool
: public VectorPool
188 void *operator new(size_t);
189 void operator delete (void *);
192 virtual char const *label() const {return "Individual";}
194 virtual unsigned int makeKey (IpAddress
&src_addr
) const;
198 /// \ingroup DelayPoolsInternal
199 class ClassCNetPool
: public VectorPool
203 void *operator new(size_t);
204 void operator delete (void *);
207 virtual char const *label() const {return "Network";}
209 virtual unsigned int makeKey (IpAddress
&src_addr
) const;
212 /* don't use remote storage for these */
213 /// \ingroup DelayPoolsInternal
218 bool individualUsed (unsigned int index
)const;
219 unsigned char findHostMapPosition (unsigned char const host
) const;
220 bool individualAllocated (unsigned char host
) const;
221 unsigned char hostPosition (DelaySpec
&rate
, unsigned char const host
);
222 void initHostIndex (DelaySpec
&rate
, unsigned char index
, unsigned char host
);
223 void update (DelaySpec
const &, int incr
);
224 void stats(StoreEntry
*)const;
227 VectorMap
<unsigned char, DelayBucket
> individuals
;
230 /// \ingroup DelayPoolsInternal
231 class ClassCHostPool
: public CompositePoolNode
235 typedef RefCount
<ClassCHostPool
> Pointer
;
236 virtual void dump(StoreEntry
*entry
) const;
237 virtual void parse();
238 virtual void update(int incr
);
239 virtual void stats(StoreEntry
* sentry
);
241 virtual DelayIdComposite::Pointer
id(CompositeSelectionDetails
&);
246 bool keyAllocated (unsigned char const key
) const;
247 virtual DelaySpec
*rate() {return &spec
;}
249 virtual DelaySpec
const *rate() const {return &spec
;}
251 virtual char const *label() const {return "Individual";}
253 virtual unsigned int makeKey (IpAddress
&src_addr
) const;
255 unsigned char makeHostKey (IpAddress
&src_addr
) const;
258 VectorMap
<unsigned char, ClassCBucket
> buckets
;
262 friend class ClassCHostPool::Id
;
264 /// \ingroup DelayPoolsInternal
265 class Id
:public DelayIdComposite
269 void *operator new(size_t);
270 void operator delete (void *);
271 Id (RefCount
<ClassCHostPool
>, unsigned char, unsigned char);
272 virtual int bytesWanted (int min
, int max
) const;
273 virtual void bytesIn(int qty
);
276 RefCount
<ClassCHostPool
> theClassCHost
;
277 unsigned char theNet
;
278 unsigned char theHost
;
283 Aggregate::AggregateId::delayRead(DeferredRead
const &aRead
)
285 theAggregate
->delayRead(aRead
);
289 CommonPool::operator new(size_t size
)
291 DelayPools::MemoryUsed
+= sizeof (CommonPool
);
292 return ::operator new (size
);
296 CommonPool::operator delete (void *address
)
298 DelayPools::MemoryUsed
-= sizeof (CommonPool
);
299 ::operator delete (address
);
303 CommonPool::Factory(unsigned char _class
, CompositePoolNode::Pointer
& compositeCopy
)
305 CommonPool
*result
= new CommonPool
;
313 compositeCopy
= new Aggregate
;
314 result
->typeLabel
= "1";
318 result
->typeLabel
= "2";
320 DelayVector::Pointer temp
= new DelayVector
;
321 compositeCopy
= temp
.getRaw();
322 temp
->push_back (new Aggregate
);
323 temp
->push_back(new IndividualPool
);
329 result
->typeLabel
= "3";
331 DelayVector::Pointer temp
= new DelayVector
;
332 compositeCopy
= temp
.getRaw();
333 temp
->push_back (new Aggregate
);
334 temp
->push_back (new ClassCNetPool
);
335 temp
->push_back (new ClassCHostPool
);
341 result
->typeLabel
= "4";
343 DelayVector::Pointer temp
= new DelayVector
;
344 compositeCopy
= temp
.getRaw();
345 temp
->push_back (new Aggregate
);
346 temp
->push_back (new ClassCNetPool
);
347 temp
->push_back (new ClassCHostPool
);
348 temp
->push_back (new DelayUser
);
354 result
->typeLabel
= "5";
355 compositeCopy
= new DelayTagged
;
359 fatal ("unknown delay pool class");
366 CommonPool::CommonPool()
370 ClassCBucket::update (DelaySpec
const &rate
, int incr
)
372 /* If we aren't active, don't try to update us ! */
373 assert (rate
.restore_bps
!= -1);
375 for (unsigned char j
= 0; j
< individuals
.size(); ++j
)
376 individuals
.values
[j
].update (rate
, incr
);
380 ClassCBucket::stats(StoreEntry
*sentry
)const
382 for (unsigned int j
= 0; j
< individuals
.size(); ++j
) {
383 assert (individualUsed (j
));
384 storeAppendPrintf(sentry
, " %d:",individuals
.key_map
[j
]);
385 individuals
.values
[j
].stats (sentry
);
390 ClassCBucket::findHostMapPosition (unsigned char const host
) const
392 return individuals
.findKeyIndex(host
);
396 ClassCBucket::individualUsed (unsigned int index
)const
398 return individuals
.indexUsed(index
);
402 ClassCBucket::individualAllocated (unsigned char host
) const
404 return individualUsed(findHostMapPosition (host
));
408 ClassCBucket::hostPosition (DelaySpec
&rate
, unsigned char const host
)
410 if (individualAllocated (host
))
411 return findHostMapPosition(host
);
413 assert (!individualUsed (findHostMapPosition(host
)));
415 unsigned char result
= findHostMapPosition(host
);
417 initHostIndex (rate
, result
, host
);
423 ClassCBucket::initHostIndex (DelaySpec
&rate
, unsigned char index
, unsigned char host
)
425 assert (!individualUsed(index
));
427 unsigned char const newIndex
= individuals
.insert (host
);
429 /* give the bucket a default value */
430 individuals
.values
[newIndex
].init (rate
);
434 CompositePoolNode::operator new(size_t size
)
436 DelayPools::MemoryUsed
+= sizeof (CompositePoolNode
);
437 return ::operator new (size
);
441 CompositePoolNode::operator delete (void *address
)
443 DelayPools::MemoryUsed
-= sizeof (CompositePoolNode
);
444 ::operator delete (address
);
448 Aggregate::operator new(size_t size
)
450 DelayPools::MemoryUsed
+= sizeof (Aggregate
);
451 return ::operator new (size
);
455 Aggregate::operator delete (void *address
)
457 DelayPools::MemoryUsed
-= sizeof (Aggregate
);
458 ::operator delete (address
);
461 Aggregate::Aggregate()
463 theBucket
.init (*rate());
464 DelayPools::registerForUpdates (this);
467 Aggregate::~Aggregate()
469 DelayPools::deregisterForUpdates (this);
473 Aggregate::stats(StoreEntry
* sentry
)
475 rate()->stats (sentry
, "Aggregate");
477 if (rate()->restore_bps
== -1)
480 storeAppendPrintf(sentry
, "\t\tCurrent: ");
482 theBucket
.stats(sentry
);
484 storeAppendPrintf(sentry
, "\n\n");
488 Aggregate::dump(StoreEntry
*entry
) const
490 rate()->dump (entry
);
494 Aggregate::update(int incr
)
496 theBucket
.update(*rate(), incr
);
506 DelayIdComposite::Pointer
508 Aggregate::id(CompositeSelectionDetails
&details
)
510 if (rate()->restore_bps
!= -1)
511 return new AggregateId (this);
513 return new NullDelayId
;
517 Aggregate::AggregateId::operator new(size_t size
)
519 DelayPools::MemoryUsed
+= sizeof (AggregateId
);
520 return ::operator new (size
);
524 Aggregate::AggregateId::operator delete (void *address
)
526 DelayPools::MemoryUsed
-= sizeof (AggregateId
);
527 ::operator delete (address
);
530 Aggregate::AggregateId::AggregateId(RefCount
<Aggregate
> anAggregate
) : theAggregate(anAggregate
)
534 Aggregate::AggregateId::bytesWanted (int min
, int max
) const
536 return theAggregate
->theBucket
.bytesWanted(min
, max
);
540 Aggregate::AggregateId::bytesIn(int qty
)
542 theAggregate
->theBucket
.bytesIn(qty
);
543 theAggregate
->kickReads();
546 DelayPool
*DelayPools::delay_data
= NULL
;
547 time_t DelayPools::LastUpdate
= 0;
548 unsigned short DelayPools::pools_ (0);
551 DelayPools::RegisterWithCacheManager(void)
553 CacheManager::GetInstance()->
554 registerAction("delay", "Delay Pool Levels", Stats
, 0, 1);
560 LastUpdate
= getCurrentTime();
561 RegisterWithCacheManager();
566 DelayPools::InitDelayData()
571 DelayPools::delay_data
= new DelayPool
[pools()];
573 DelayPools::MemoryUsed
+= pools() * sizeof(DelayPool
);
575 eventAdd("DelayPools::Update", DelayPools::Update
, NULL
, 1.0, 1);
579 DelayPools::FreeDelayData()
581 eventDelete(DelayPools::Update
, NULL
);
582 delete[] DelayPools::delay_data
;
583 DelayPools::MemoryUsed
-= pools() * sizeof(*DelayPools::delay_data
);
588 DelayPools::Update(void *unused
)
593 eventAdd("DelayPools::Update", Update
, NULL
, 1.0, 1);
595 int incr
= squid_curtime
- LastUpdate
;
600 LastUpdate
= squid_curtime
;
602 Vector
<Updateable
*>::iterator pos
= toUpdate
.begin();
604 while (pos
!= toUpdate
.end()) {
605 (*pos
)->update(incr
);
611 DelayPools::registerForUpdates(Updateable
*anObject
)
613 /* Assume no doubles */
614 toUpdate
.push_back(anObject
);
618 DelayPools::deregisterForUpdates (Updateable
*anObject
)
620 Vector
<Updateable
*>::iterator pos
= toUpdate
.begin();
622 while (pos
!= toUpdate
.end() && *pos
!= anObject
) {
626 if (pos
!= toUpdate
.end()) {
627 /* move all objects down one */
628 Vector
<Updateable
*>::iterator temp
= pos
;
631 while (pos
!= toUpdate
.end()) {
641 Vector
<Updateable
*> DelayPools::toUpdate
;
644 DelayPools::Stats(StoreEntry
* sentry
)
648 storeAppendPrintf(sentry
, "Delay pools configured: %d\n\n", DelayPools::pools());
650 for (i
= 0; i
< DelayPools::pools(); ++i
) {
651 if (DelayPools::delay_data
[i
].theComposite().getRaw()) {
652 storeAppendPrintf(sentry
, "Pool: %d\n\tClass: %s\n\n", i
+ 1, DelayPools::delay_data
[i
].pool
->theClassTypeLabel());
653 DelayPools::delay_data
[i
].theComposite()->stats (sentry
);
655 storeAppendPrintf(sentry
, "\tMisconfigured pool.\n\n");
658 storeAppendPrintf(sentry
, "Memory Used: %d bytes\n", (int) DelayPools::MemoryUsed
);
662 DelayPools::FreePools()
664 if (!DelayPools::pools())
677 DelayPools::pools (u_short newPools
)
680 debugs(3, 0, "parse_delay_pool_count: multiple delay_pools lines, aborting all previous delay_pools config");
690 template <class Key
, class Value
>
691 VectorMap
<Key
,Value
>::VectorMap() : nextMapPosition(0)
694 template <class Key
, class Value
>
696 VectorMap
<Key
,Value
>::size() const
698 return nextMapPosition
;
701 template <class Key
, class Value
>
703 VectorMap
<Key
,Value
>::insert (Key
const key
)
705 unsigned char index
= findKeyIndex (key
);
706 assert (!indexUsed(index
));
708 key_map
[index
] = key
;
716 IndividualPool::operator new(size_t size
)
718 DelayPools::MemoryUsed
+= sizeof (IndividualPool
);
719 return ::operator new (size
);
723 IndividualPool::operator delete (void *address
)
725 DelayPools::MemoryUsed
-= sizeof (IndividualPool
);
726 ::operator delete (address
);
729 VectorPool::VectorPool()
731 DelayPools::registerForUpdates (this);
734 VectorPool::~VectorPool()
736 DelayPools::deregisterForUpdates (this);
740 VectorPool::stats(StoreEntry
* sentry
)
742 rate()->stats (sentry
, label());
744 if (rate()->restore_bps
== -1) {
745 storeAppendPrintf(sentry
, "\n\n");
749 storeAppendPrintf(sentry
, "\t\tCurrent:");
751 for (unsigned int i
= 0; i
< buckets
.size(); i
++) {
752 storeAppendPrintf(sentry
, " %d:", buckets
.key_map
[i
]);
753 buckets
.values
[i
].stats(sentry
);
757 storeAppendPrintf(sentry
, " Not used yet.");
759 storeAppendPrintf(sentry
, "\n\n");
763 VectorPool::dump(StoreEntry
*entry
) const
765 rate()->dump (entry
);
769 VectorPool::update(int incr
)
771 if (rate()->restore_bps
== -1)
774 for (unsigned int i
= 0; i
< buckets
.size(); ++i
)
775 buckets
.values
[i
].update (*rate(), incr
);
785 VectorPool::keyAllocated (unsigned char const key
) const
787 return buckets
.indexUsed(buckets
.findKeyIndex (key
));
790 template <class Key
, class Value
>
792 VectorMap
<Key
,Value
>::indexUsed (unsigned char const index
) const
794 return index
< size();
797 /** returns the used position, or the position to allocate */
798 template <class Key
, class Value
>
800 VectorMap
<Key
,Value
>::findKeyIndex (Key
const key
) const
802 for (unsigned int index
= 0; index
< size(); ++index
) {
803 assert (indexUsed (index
));
805 if (key_map
[index
] == key
)
813 DelayIdComposite::Pointer
815 VectorPool::id(CompositeSelectionDetails
&details
)
817 if (rate()->restore_bps
== -1)
818 return new NullDelayId
;
820 unsigned int key
= makeKey (details
.src_addr
);
822 if (keyAllocated (key
))
823 return new Id (this, buckets
.findKeyIndex(key
));
825 unsigned char const resultIndex
= buckets
.insert(key
);
827 buckets
.values
[resultIndex
].init (*rate());
829 return new Id(this, resultIndex
);
833 VectorPool::Id::operator new(size_t size
)
835 DelayPools::MemoryUsed
+= sizeof (Id
);
836 return ::operator new (size
);
840 VectorPool::Id::operator delete (void *address
)
842 DelayPools::MemoryUsed
-= sizeof (Id
);
843 ::operator delete (address
);
846 VectorPool::Id::Id (VectorPool::Pointer aPool
, int anIndex
) : theVector (aPool
), theIndex (anIndex
)
850 VectorPool::Id::bytesWanted (int min
, int max
) const
852 return theVector
->buckets
.values
[theIndex
].bytesWanted (min
, max
);
856 VectorPool::Id::bytesIn(int qty
)
858 theVector
->buckets
.values
[theIndex
].bytesIn (qty
);
862 IndividualPool::makeKey (IpAddress
&src_addr
) const
864 /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
865 if ( !src_addr
.IsIPv4() )
868 /* Temporary bypass for IPv4-only */
870 src_addr
.GetInAddr(host
);
871 return (ntohl(host
.s_addr
) & 0xff);
875 ClassCNetPool::operator new(size_t size
)
877 DelayPools::MemoryUsed
+= sizeof (ClassCNetPool
);
878 return ::operator new (size
);
882 ClassCNetPool::operator delete (void *address
)
884 DelayPools::MemoryUsed
-= sizeof (ClassCNetPool
);
885 ::operator delete (address
);
889 ClassCNetPool::makeKey (IpAddress
&src_addr
) const
891 /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
892 if ( !src_addr
.IsIPv4() )
895 /* Temporary bypass for IPv4-only */
897 src_addr
.GetInAddr(net
);
898 return ( (ntohl(net
.s_addr
) >> 8) & 0xff);
902 ClassCHostPool::ClassCHostPool()
904 DelayPools::registerForUpdates (this);
907 ClassCHostPool::~ClassCHostPool()
909 DelayPools::deregisterForUpdates (this);
913 ClassCHostPool::stats(StoreEntry
* sentry
)
915 rate()->stats (sentry
, label());
917 if (rate()->restore_bps
== -1) {
918 storeAppendPrintf(sentry
, "\n\n");
922 for (unsigned int index
= 0; index
< buckets
.size(); ++index
) {
923 storeAppendPrintf(sentry
, "\t\tCurrent [Network %d]:", buckets
.key_map
[index
]);
924 buckets
.values
[index
].stats (sentry
);
925 storeAppendPrintf(sentry
, "\n");
929 storeAppendPrintf(sentry
, "\t\tCurrent [All networks]: Not used yet.\n");
931 storeAppendPrintf(sentry
, "\n\n");
935 ClassCHostPool::dump(StoreEntry
*entry
) const
937 rate()->dump (entry
);
941 ClassCHostPool::update(int incr
)
943 if (rate()->restore_bps
== -1)
946 for (unsigned int i
= 0; i
< buckets
.size(); ++i
)
947 buckets
.values
[i
].update (*rate(), incr
);
951 ClassCHostPool::parse()
957 ClassCHostPool::keyAllocated (unsigned char const key
) const
959 return buckets
.indexUsed(buckets
.findKeyIndex (key
));
963 ClassCHostPool::makeHostKey (IpAddress
&src_addr
) const
965 /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
966 if ( !src_addr
.IsIPv4() )
969 /* Temporary bypass for IPv4-only */
971 src_addr
.GetInAddr(host
);
972 return (ntohl(host
.s_addr
) & 0xff);
976 ClassCHostPool::makeKey (IpAddress
&src_addr
) const
978 /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
979 if ( !src_addr
.IsIPv4() )
982 /* Temporary bypass for IPv4-only */
984 src_addr
.GetInAddr(net
);
985 return ( (ntohl(net
.s_addr
) >> 8) & 0xff);
988 DelayIdComposite::Pointer
990 ClassCHostPool::id(CompositeSelectionDetails
&details
)
992 if (rate()->restore_bps
== -1)
993 return new NullDelayId
;
995 unsigned int key
= makeKey (details
.src_addr
);
997 unsigned char host
= makeHostKey (details
.src_addr
);
999 unsigned char hostIndex
;
1001 unsigned char netIndex
;
1003 if (keyAllocated (key
))
1004 netIndex
= buckets
.findKeyIndex(key
);
1006 netIndex
= buckets
.insert (key
);
1008 hostIndex
= buckets
.values
[netIndex
].hostPosition (*rate(), host
);
1010 return new Id (this, netIndex
, hostIndex
);
1014 ClassCHostPool::Id::operator new(size_t size
)
1016 DelayPools::MemoryUsed
+= sizeof (Id
);
1017 return ::operator new (size
);
1021 ClassCHostPool::Id::operator delete (void *address
)
1023 DelayPools::MemoryUsed
-= sizeof (Id
);
1024 ::operator delete (address
);
1027 ClassCHostPool::Id::Id (ClassCHostPool::Pointer aPool
, unsigned char aNet
, unsigned char aHost
) : theClassCHost (aPool
), theNet (aNet
), theHost (aHost
)
1031 ClassCHostPool::Id::bytesWanted (int min
, int max
) const
1033 return theClassCHost
->buckets
.values
[theNet
].individuals
.values
[theHost
].bytesWanted (min
, max
);
1037 ClassCHostPool::Id::bytesIn(int qty
)
1039 theClassCHost
->buckets
.values
[theNet
].individuals
.values
[theHost
].bytesIn (qty
);