From Newsgroup: comp.lang.tcl
On 6/30/2026 3:17 AM, David Gravereaux wrote:
Would that also be a feasable design for you?
No.-a Not for errors.-a That isn't the meaning of TCL_EXCEPTION.-a It is an alternate path like interrupts in GPIB, TCP urgent flag, QOS notices, etc
If I call Tcl_NotifyChannel(chan, TCL_EXCEPTION) in my Tcl_EventProc
after the prior Tcl_EventCheckProc, what handler does it run? None, as fileevent doesn't have "exception" as a valid event. All the pathways
are there. What I do with the TCL_EXCEPTION watchMask, and resultant
script it runs, is up to me
I already wrote the decoder for FLOWSPEC
/*
*----------------------------------------------------------------------
*
* DecodeQosFlowspec --
*
* Decodes the info from the QOS struct.
*
* Results:
* A Tcl_Obj* as a dict
*
* Side effects:
*
*----------------------------------------------------------------------
*/
Tcl_Obj *
DecodeQosFlowspec(QOS *qosPtr)
{
Tcl_Obj *dictPtr = Tcl_NewDictObj();
// Helper macro to clean up dictionary building
#define SET_DICT_INT(dict, direction, field, value) \
Tcl_DictObjPut(NULL, dict, \
Tcl_NewStringObj(#direction "_" #field, -1), \
Tcl_NewWideIntObj((Tcl_WideInt)value))
// Parse Outbound Flow Specification (Sending)
SET_DICT_INT(dictPtr, send, TokenRate, qosPtr->SendingFlowspec.TokenRate);
SET_DICT_INT(dictPtr, send, TokenBucketSize, qosPtr->SendingFlowspec.TokenBucketSize);
SET_DICT_INT(dictPtr, send, PeakBandwidth, qosPtr->SendingFlowspec.PeakBandwidth);
SET_DICT_INT(dictPtr, send, Latency,
qosPtr->SendingFlowspec.Latency);
SET_DICT_INT(dictPtr, send, DelayVariation, qosPtr->SendingFlowspec.DelayVariation);
SET_DICT_INT(dictPtr, send, ServiceType, qosPtr->SendingFlowspec.ServiceType);
SET_DICT_INT(dictPtr, send, MaxSduSize, qosPtr->SendingFlowspec.MaxSduSize);
SET_DICT_INT(dictPtr, send, MinimumPolicedSize, qosPtr->SendingFlowspec.MinimumPolicedSize);
// Parse Inbound Flow Specification (Receiving)
SET_DICT_INT(dictPtr, recv, TokenRate, qosPtr->ReceivingFlowspec.TokenRate);
SET_DICT_INT(dictPtr, recv, TokenBucketSize, qosPtr->ReceivingFlowspec.TokenBucketSize);
SET_DICT_INT(dictPtr, recv, PeakBandwidth, qosPtr->ReceivingFlowspec.PeakBandwidth);
SET_DICT_INT(dictPtr, recv, Latency,
qosPtr->ReceivingFlowspec.Latency);
SET_DICT_INT(dictPtr, recv, DelayVariation, qosPtr->ReceivingFlowspec.DelayVariation);
SET_DICT_INT(dictPtr, recv, ServiceType, qosPtr->ReceivingFlowspec.ServiceType);
SET_DICT_INT(dictPtr, recv, MaxSduSize, qosPtr->ReceivingFlowspec.MaxSduSize);
SET_DICT_INT(dictPtr, recv, MinimumPolicedSize, qosPtr->ReceivingFlowspec.MinimumPolicedSize);
#undef SET_DICT_INT
return dictPtr;
}
--- Synchronet 3.22a-Linux NewsLink 1.2