• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

vb.net latiency w/Variables byVal

I have an app that I am writing to accept messages, and I parse the messages by passing them to a function.  What I am finding is that when I pass large string variables that not all the variable that is passed is totally populated when I start to process the msg in the function.  

Is this behavior normal ?  I thought the dev environment made sure that that all var's were totally populated before launching the function ?

Thanks
0
sidwelle
Asked:
sidwelle
  • 3
3 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
Can you post the code, and sample inputs, you are using to demonstrate your problem?
0
 
sidwelleAuthor Commented:
My app is already about 1000 lines, don't want to try and post it here.  What I am having problems with is that it receives msgs via tcp-ip on a second thread that are about 500 chrs and pass these strings back to the main thread to be processed (via delegate).  What I am noticing is that as the strings are passed from function to function to be processed when they get to the different functions, it appears that the string vars are not totally populated.

Today I was working changing all the string var specification from default ByVal to ByRef to see if that makes a difference.

I will post back tomorrow.
0
 
sidwelleAuthor Commented:
Changed all the ByVal statements to ByRef, but I think I found the problem where I had the value I wanted passing through two Delegate statements.

Thought it did not matter how many Delegate functions the values had to pass thought, but apparently it does.

Seems to be working now.
0
 
mastiSoftCommented:
did you check the buffer size?  maybe you have to make it's bigger or send string in smaller packages
0
 
sidwelleAuthor Commented:
Problem was definitely multiple Delegate statements.

Things are working correctly now.

Thanks to everyone who took a look.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now