Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 15 of 15

Thread: Partial messages problem with Java non-blocking socket communication

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Unhappy Partial messages problem with Java non-blocking socket communication

    message deleted
    Last edited by perl0101; May 24th, 2011 at 11:48 AM.


  2. #2
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    message deleted.
    Last edited by perl0101; May 24th, 2011 at 11:48 AM.

  3. #3
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Partial messages problem with Java non-blocking socket communication

    Could you post your code? It's kind of hard for us to figure out what's wrong without it.

  4. #4
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    message delted
    Last edited by perl0101; May 24th, 2011 at 11:48 AM.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    partial message exception
    Can you post the full text of the message so we can research it?
    Who generates the message?

    java non-blocking socket
    Can you give me the class/method for a java non-blocking socke?



    rbuf.get(b, 0, n);
    dataBuffer.put(b);

    Does the get() method return the number of bytes read? Can it be less than n?
    Last edited by Norm; July 27th, 2010 at 02:45 PM.

  6. The Following User Says Thank You to Norm For This Useful Post:

    perl0101 (July 27th, 2010)

  7. #6
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    delete message
    Last edited by perl0101; May 24th, 2011 at 11:49 AM.

  8. #7
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    @perl0101 when you post code place it between the tags in helloworlds signature.

  9. The Following User Says Thank You to Brt93yoda For This Useful Post:

    perl0101 (July 27th, 2010)

  10. #8
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    message deleted
    Last edited by perl0101; May 24th, 2011 at 11:49 AM.

  11. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    Your posted error message says that there is a missing tag in the data.
    Was the tag in the data being sent?
    If it was, can you look at the received data and see what is missing? Or what was extra that confused the parser.

    What tests do you do to see that the data that was sent, was received?
    For example have a log on both ends that records the number of bytes sent on the sending side and the number received on the receiving side. Are there differences in the two logs?
    Are there more or less bytes received than sent?

  12. #10
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    message delted
    Last edited by perl0101; May 24th, 2011 at 11:49 AM.

  13. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    Can you dump for viewing the records with missing/extra data to see what is happening?
    how do you know that "messages can not be received completely"?
    Would bad data in the middle or extra data in the middle also case the parser to fail?

  14. #12
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    message delted
    Last edited by perl0101; May 24th, 2011 at 11:50 AM.

  15. #13
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    Sorry, I've no idea about how your programs work.
    What are in the additional 1476 bytes that machine B reads?
    Does it show any relationship to the 6526 bytes sent earlier?

  16. The Following User Says Thank You to Norm For This Useful Post:

    perl0101 (July 28th, 2010)

  17. #14
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    message delted
    Last edited by perl0101; May 24th, 2011 at 11:50 AM.

  18. #15
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Partial messages problem with Java non-blocking socket communication

    Hard to tell what is happening from here.
    Good luck with the project.

Similar Threads

  1. Java socket programming
    By lucy in forum Java Networking
    Replies: 1
    Last Post: April 26th, 2010, 09:13 PM
  2. communication protocol
    By isaac in forum Java Networking
    Replies: 1
    Last Post: February 5th, 2010, 08:20 AM
  3. callback functions? non-blocking socket help
    By Tomas in forum Java Networking
    Replies: 0
    Last Post: September 12th, 2009, 06:46 PM
  4. servlet applet communication
    By prashanthi_asn in forum Java Servlet
    Replies: 0
    Last Post: May 21st, 2009, 12:50 AM
  5. Replies: 1
    Last Post: April 20th, 2009, 11:17 AM