Search:

Type: Posts; User: perl0101

Search: Search took 0.07 seconds.

  1. Replies
    8
    Views
    2,631

    Re: server/client communication problem

    thank you.
  2. Replies
    8
    Views
    2,631

    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?
  3. Replies
    8
    Views
    2,631

    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...
  4. Replies
    8
    Views
    2,631

    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...
  5. Replies
    8
    Views
    2,631

    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...
Results 1 to 5 of 5