Search:

Type: Posts; User: perl0101

Search: Search took 0.08 seconds.

  1. Replies
    2
    Views
    2,086

    Partial message problem

    Hi everyone,

    My sending messages may be larger than the default socket buffer size. So there may be several read operations in order to receive a complete message. When the end condition is
    ...
  2. Replies
    8
    Views
    2,627

    Re: server/client communication problem

    thank you.
  3. Replies
    8
    Views
    2,627

    Re: server/client communication problem

    socket is an instance of SocketChannel.

    If I add an interval between messages, the problem is not there. I just feel that adding an interval may not be a good solution. Is there other ways?
  4. Replies
    8
    Views
    2,627

    Re: server/client communication problem

    Thank you. But the SocketChannel class just provide method to read a chunk, instead of byte by byte. Is there any way to read the header and get message size first. Then I can read the required...
  5. Replies
    8
    Views
    2,627

    Re: server/client communication problem

    For read:

    n = socket.read(rbuf);
    if (((n==0) || (n==-1))) {
    logger.logInfo("t=" + t + " count=" + count + " and break."); //5-21-11
    break;
    }


    For...
  6. Replies
    8
    Views
    2,627

    server/client communication problem

    I am confused with my project.

    It is a server/client system which uses java nio.

    The requiremet is that the server keep sending 10 messages to the client. Then the client read messages. But the...
  7. Re: How to seperate several messages in a byte buffer

    Thank you. It works.
  8. Re: How to seperate several messages in a byte buffer

    Than you for your suggestions. I will experiment with it today.
  9. How to seperate several messages in a byte buffer

    I send messages through socket. For each read operation, several messags might be queued in a byte buffer at one time. I use a special character '^' which ascii value is 94 as a seperator. The...
  10. Replies
    3
    Views
    2,984

    Re: Java nio socket for peer to peer model

    Thanks for your suggestions in advance.
  11. Replies
    3
    Views
    2,984

    Java nio socket for peer to peer model

    message delted
  12. Re: Partial messages problem with Java non-blocking socket communication

    message delted
  13. Re: Partial messages problem with Java non-blocking socket communication

    message delted
  14. Re: Partial messages problem with Java non-blocking socket communication

    message delted
  15. Re: Partial messages problem with Java non-blocking socket communication

    message deleted
  16. Re: Partial messages problem with Java non-blocking socket communication

    delete message
  17. Re: Partial messages problem with Java non-blocking socket communication

    message delted
  18. Re: Partial messages problem with Java non-blocking socket communication

    message deleted.
  19. Partial messages problem with Java non-blocking socket communication

    message deleted
Results 1 to 19 of 19