-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative size #1
Comments
Following the other packets types I think the call is supposed to be On Tue, Mar 11, 2014 at 1:55 PM, viorelstolea [email protected]:
|
Thanks for replying. Now I still get the NullPointerException: message received->Hello World This happens here in Socket.java: /* Send unicast SPMR with regular TTL */ because peer.getNetworkLayerAddress() returns null. in Peer.java: public InetAddress getNetworkLayerAddress() { this.nla is null! Thanks again! On Mon, Mar 17, 2014 at 1:47 PM, Steven McCoy [email protected]:
|
Aha, SPM-R should use local_nla - obtained from inspecting local packets, On Mon, Mar 17, 2014 at 3:28 PM, viorelstolea [email protected]:
|
For reference, the C implementation handling of SPM-R: https://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/receiver.c#980 On Mon, Mar 17, 2014 at 3:43 PM, Steven McCoy [email protected] wrote:
|
Aha indeed! :) Thanks On Mon, Mar 17, 2014 at 3:44 PM, Steven McCoy [email protected]:
|
This code is from Socket.java
sendSpmr(Peer peer)
...
SocketBuffer skb = SourcePathMessageRequest.create();
after this call skb len is -16
when later trying to create the datagram
I get illegal length or offset (see below)...
Hello World
skb= { "timestamp": 0, "tsi": "null", "sequence": null, "len": -16, "header": { "pgm_sport": 1314, "pgm_dport": 26230, "pgm_type": "PGM_SPMR", "pgm_options": "", "pgm_checksum": 47876, "pgm_gsi": "238.246.220.58.2.49", "pgm_tsdu_length": 0 }, "odata": null, "opt_fragment": null, "buf": { "head": 0, "data": 16, "tail": 0, "end": 16, "length": 16 } }
Exception in thread "Thread-2" skb.getDataOffset()=16, skb.getLength()=-16
java.lang.IllegalArgumentException: illegal length or offset
at java.net.DatagramPacket.setData(DatagramPacket.java:264)
at java.net.DatagramPacket.(DatagramPacket.java:116)
at hk.miru.javapgm.Socket.sendSpmr(Socket.java:2119)
at hk.miru.javapgm.Socket.checkPeerState(Socket.java:1735)
at hk.miru.javapgm.Socket.timerDispatch(Socket.java:1647)
at hk.miru.javapgm.Socket.receive(Socket.java:1029)
at com.peltech.ea.PGMTransport$ReaderThread.run(PGMTransport.java:183)
at java.lang.Thread.run(Thread.java:722)
If I fix the code above, I get into another issue: peer.getNetworkLayerAddress() returns null (is not set) and after setting it to null with the statement below
pkt.setAddress(peer.getNetworkLayerAddress());
I get the exception below.
Hello World
skb= { "timestamp": 0, "tsi": "null", "sequence": null, "len": 16, "header": { "pgm_sport": 1314, "pgm_dport": 16785, "pgm_type": "PGM_SPMR", "pgm_options": "", "pgm_checksum": 57321, "pgm_gsi": "238.246.220.58.2.49", "pgm_tsdu_length": 0 }, "odata": null, "opt_fragment": null, "buf": { "head": 0, "data": 0, "tail": 16, "end": 16, "length": 16 } }
skb.getDataOffset()=0, skb.getLength()=16
Exception in thread "Thread-2" java.lang.NullPointerException: null address || null buffer
at java.net.TwoStacksPlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:676)
at hk.miru.javapgm.Socket.sendSpmr(Socket.java:2135)
at hk.miru.javapgm.Socket.checkPeerState(Socket.java:1735)
at hk.miru.javapgm.Socket.timerDispatch(Socket.java:1647)
at hk.miru.javapgm.Socket.receive(Socket.java:1029)
at com.peltech.ea.PGMTransport$ReaderThread.run(PGMTransport.java:183)
at java.lang.Thread.run(Thread.java:722)
Thank you
The text was updated successfully, but these errors were encountered: