Home Forums Support Sending a data with TCP

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #906
    Anonymous
    Inactive

    Hi, I’m working on a server project and I must ask this. If I want to send ~4kb data with TCP (from client to server), Is the server TCP listener can handle this data with one more operation? Namely I sent ~4kb data and server received this data with 2 operation like 1: ~1kb, 2: ~3kb. Is that impossible? (If this impossible I’ll send data with a header)

    #907
    Anonymous
    Inactive

    Heya freaka61,

    Welcome to our forums. May I clarify that you are using our library to perform the TCP send?

    Regards,
    Marc

    #908
    Anonymous
    Inactive

    Yes. I’ll use networkcomms.

    #909
    Anonymous
    Inactive

    Sorry, I don’t think I understand your question.

    If you use our network library and send 4KB of data you are guaranteed to receive exactly 4KB of data.

    Regards,
    Marc

    #910
    Anonymous
    Inactive

    Namely if I implement a system like this:

    private void HandleData(byte[] data)
    {
       Console.WriteLine("> {0}", Encoding.UTF8.GetString(data));
    }

    If I send “asdfghjkl” with your library (TCP), may I take a output like this:

    > asd
    > fghj
    > kl

    I mean if client send a data in one operation, may server receives this data in one more operations?

    #911
    Anonymous
    Inactive

    Using NetworkComms.Net you do not need to encode your own data, your HandleData method only needs to be the following for a string:

    private void HandleData(string data)
    {
       Console.WriteLine("{0}", data);
    }

    This is guaranteed to be received as one operation.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.