USNavalResearchLaboratory / norm

NACK-Oriented Reliable Multicast (NORM) implementation & tools (RFCs 5740, 5401)
https://www.nrl.navy.mil/Our-Work/Areas-of-Research/Information-Technology/NCS/NORM/
Other
96 stars 33 forks source link

pynorm: type hints,enum,missed return value,normCast.py #74

Closed honglei closed 1 year ago

honglei commented 1 year ago

1, add type hints for pynorm 2, use enum instead of int variables in constants.py 3, fix missed functions and return boolean values for some functions. 4, fix some return values to python/human readable ones.

bebopagogo commented 1 year ago

I incorporated most of your changes from this pull request in a commit I just executed. The only things I did not incorporate are: 1) The code modifications to get "REPORT" notifications and fetch the report contents. I want to do something a little different than the approach you took here. I can reconsider this. The changes you made were not too intrusive. My longer term objective is a sort of type-length-value to fetch metrics from the underlying statistics tracked for the reporting. I need to think about this one more. 2) You had some code in the Python bindings to set a hash index for NormSession objects. I am not clear on why this is needed. Can't you use the existing NormSessionHandle value for that purpose?

I also updated the norm/examples/python/normMsgr.py and tested it. I also added your norm/examples/python/normCast.py code but did not yet thoroughly test it. It needs a little refinement to match the normCast.cpp example (e.g., the "updates only" option for sending fresh files from an "outbox" directory, etc), but you did a lot of good work to replicate most of the functionality.

Thank you very much for your contributions here.

honglei commented 1 year ago

it's an honor to do some contributions to this wonderful project. 1) I just need a quick way to get the infomation of "REPORT", it's not well designed. 2) User may use their own hash index for NormSession objects rather than the internal NormSessionHandle. For example, users may prefer use a user-defined name for each NormSession, and this name is the primary key field in database table for each multicast NormSession.