[jboss-jira] [JBoss JIRA] (JGRP-1727) McastReceiverTest output does not display correctly on Windows

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Fri Nov 1 12:10:02 EDT 2013


    [ https://issues.jboss.org/browse/JGRP-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829518#comment-12829518 ] 

Richard Achmatowicz commented on JGRP-1727:
-------------------------------------------

The problem is is the following: when a DatagramPacket is received by McastReceiverTest, a String used for display of the payload is created as follows: 
{noformat}
new String(packet.getData())
{noformat}
where the size of the array returned by DatagramPacket.getData()  is fixed at 256. Any data in the buffer is followed by zeros.
On Linux, this seems to work fine to create the right String; on Windows, the String created contains the trailing zeros and the display gets messed up.

This can be fixed as follows:
 {noformat}
new String(packet.getData(), 0, packet.getLength())
{noformat}


 
                
> McastReceiverTest output does not display correctly on Windows
> --------------------------------------------------------------
>
>                 Key: JGRP-1727
>                 URL: https://issues.jboss.org/browse/JGRP-1727
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 3.5
>         Environment: Windows XP, Windows 7
>            Reporter: Richard Achmatowicz
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.5
>
>
> When using McastSenderTest and McastReceiverTest on Windows to check multicast connectivity, the output displayed by McastReceiverTest not presented in the same was as when running the utilities on Linux; part of the output is either completely lost (Windows 7) or the output has extra blank characters inserted (Windows XP).
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list