I imported the Winsock feature in my vb.net application, so I can make a Chat System. I just have one little problem with my program. In the GetData method of my program,
CLIENT SIDE:
*Dim strData As String*
AxWinsock1.GetData(strData, vbString)
TextBox1.Text = TextBox1.Text & _
strData & vbCrLf
It will underline the whole first line, unless have an maxLen as Object in. So I plugged in Nothing, since I thought it was optional. Now when I debug, and I send a message from the server, it won’t display anything. I put in vbByte as the maxLen object, and now it only shows part of the message. Can anyone tell me how to fix this. This works in VB6…
PS: I am not going to use the System.Namespaces function of VB.NET since, I find the Winsock feature much easier.
Thanks
vbByte is a constant with a value of 17, so you actually send a max length of 17 😉
You will want to send a bigger number as the max length. If what you want to send as a max length is the upper bound of the Byte data type you could send
Byte.MaxValue(which is 255).Edit:
I don’t know what is the upper bound, but you can try
Integer.MaxValue, or some arbitrary big value like 1000000…Looking at the documentation, I noticed two things:
maxLen should be optional, I don’t know why it would flag an error when you don’t specify it, what kind of error is it?
It’s mentioned that it’s common to use GetData with a DataArrival event, is that your case? If it is, you could pass the
totalBytesargument as the maxLen.