First time using forum. In BS program learning to use VB. Let me know if this question should be in another forum, I will probably have others, as I progress through this program. Thanks.
Problem
I have set up a console version Client program and a server program in Visual Studio- VB.Net
The goal is to input one of five stock symbols, send it to the Server program, open a .txt document, match the symbol to the line of data in the txt document and send the company name and hardcoded stockprice for that stock symbol.
The stock symbol input is held in the variable stockInput on the Client side
stockInput = Console.ReadLine()
While debugging, I can see that the format is "CSC" in stockInput, with quotation marks at beginning and end
When the data is sent to the Server, it is held in the variable clientdata.
However, again while debugging, I can see that the format is "CSC in clientdata, with quotation marks only at the beginning.
I open the .txt file which pulls the txt data into separate variables. The string variables are in the format, "CSC"
I think what is happening is that we don't make it into the if statement because "CSC" does not equal "CSC
If symbol = clientdata Then
response1 = company
response2 = price
Is there another way to bring over the input data?
Should I think about trying to strip all the quotation marks?
The other thing I noticed on the server side in line 46,
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
While debugging, if you scroll over bytes the length is 8193, if you scroll over tcpClient.ReceiveBufferSize, the length is 8192
Is that normal, or could that be the problem.
Problem
I have set up a console version Client program and a server program in Visual Studio- VB.Net
The goal is to input one of five stock symbols, send it to the Server program, open a .txt document, match the symbol to the line of data in the txt document and send the company name and hardcoded stockprice for that stock symbol.
The stock symbol input is held in the variable stockInput on the Client side
stockInput = Console.ReadLine()
While debugging, I can see that the format is "CSC" in stockInput, with quotation marks at beginning and end
When the data is sent to the Server, it is held in the variable clientdata.
However, again while debugging, I can see that the format is "CSC in clientdata, with quotation marks only at the beginning.
I open the .txt file which pulls the txt data into separate variables. The string variables are in the format, "CSC"
I think what is happening is that we don't make it into the if statement because "CSC" does not equal "CSC
If symbol = clientdata Then
response1 = company
response2 = price
Is there another way to bring over the input data?
Should I think about trying to strip all the quotation marks?
The other thing I noticed on the server side in line 46,
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
While debugging, if you scroll over bytes the length is 8193, if you scroll over tcpClient.ReceiveBufferSize, the length is 8192
Is that normal, or could that be the problem.