By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,445 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

TCP Socket Question

P: 15
I am requesting data from a server using TCP Sockets and I do not receieve all the data unless I ask for the data two times. e.g.

Expand|Select|Wrap|Line Numbers
  1. Dim cpBytesRec As Int64 = sender2.Receive(bytes)
  2. dataFromCp = Encoding.ASCII.GetString(bytes, 0, cpBytesRec)
  3. cpBytesRec = sender2.Receive(bytes)
  4. dataFromCp += Encoding.ASCII.GetString(bytes, 0, cpBytesRec)
  5.  
Im trying to figure out why the first receieve will not get all of the data?
Jul 14 '08 #1
Share this Question
Share on Google+
1 Reply


P: 15
Solved: I had to increase the amount of bytes to read.
Jul 14 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.