CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    25

    Unknown data size - Socket proggramming

    Hello,
    How can I use an unknown buffer size to store bytes which sended through a socket? [the buffer will fit itself according to the length of the data]
    Currently, I am using a big byte array, but a lot of memory is wasted because most of the time there is no need for such a big buffer

  2. #2
    Join Date
    Jul 2006
    Posts
    97

    Re: Unknown data size - Socket proggramming

    You can send the data in chunks and on the client use ArrayList or some other collection to build the complete buffer. I was also using StringBuilder in a couple of situations.
    Last edited by gecka; January 28th, 2009 at 01:51 PM.
    Using .NET 2.0

  3. #3
    Join Date
    Oct 2008
    Posts
    25

    Re: Unknown data size - Socket proggramming

    Thanks, I will try it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured