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

NormStreamSend Java Example Does Not Compile #76

Closed mullerj closed 1 year ago

mullerj commented 1 year ago

The NormStreamSend Java example does not compile.

Used the Waf build tool to configure to build the Java extension: ./waf configure --build-java Command was successful: 'configure' finished successfully (5.141s) Built the Java extension using the Waf build tool: ./waf Command was successful: 'build' finished successfully (58.831s) Switched to the Java examples directory and attempted to compile the Java examples based on the README.TXT: javac -cp ../../build/norm.jar *.java Received the following error about NormStreamSend:

NormStreamSend.java:49: error: incompatible types: possible lossy conversion from int to short
                                                                SEGMENT_SIZE, BLOCK_SIZE, PARITY_SEGMENTS);
                                                                              ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

Changed NormStreamSend BLOCK_SIZE to short on line 13: static final short BLOCK_SIZE = 64; Attempted to compile the Java examples again: javac -cp ../../build/norm.jar *.java Received the following error about NormStreamSend:

NormStreamSend.java:49: error: incompatible types: possible lossy conversion from int to short
                                                                SEGMENT_SIZE, BLOCK_SIZE, PARITY_SEGMENTS);
                                                                                          ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

Changed NormStreamSend PARITY_SEGMENTS to short on line 14: static final short PARITY_SEGMENTS = 16; Attempted to compile the Java examples again: javac -cp ../../build/norm.jar *.java Build was successful.

bebopagogo commented 1 year ago

I see you determined the issue and will check out your pull request. Note that the main Java example I am paying attention to is the "examples/java/NormMsgr.java". I have three more complete examples that I am trying to replicate in C/C++, Python, and Java:

1). normMsgr 2) normStreamer 3) normCast

At the moment only normMsgr is represented in all three but I hope to find time (or volunteers) to address this. The simpler examples are not really complete with respect to some key aspects of controlling/using NORM protocol operation. That's where these more complete examples can help.

mullerj commented 1 year ago

Thanks for the context about the examples. I'd like to help out. I'm just getting started with the Java examples. They are all compiling now, but I'm having some trouble loading the libraries. I added a Q&A in the discussions: https://github.com/USNavalResearchLaboratory/norm/discussions/75