Last post Aug 04, 2017 07:14 AM by Eric Du
Aug 03, 2017 04:15 PM|jula|LINK
A server socket application developed for receiving the data through the port.Normal strings are working good .
But now I am facing a problem which is, server socket application showing empty string when client sends a bar-code encoded strings.How can I solve the issue?
Private Sub BuildString(ByVal Bytes() As Byte, ByVal offset As Integer, ByVal count As Integer)
Dim intIndex As Integer
Dim count1 As Integer
count1 = count - 1
Dim intIndex1 As Integer
For intIndex = offset To offset + count - 1
If intIndex = count1 Then
If mobjText.ToString <> "" Then
Dim mstr, DataFmSocket As String
mstr = mobjText.ToString
Dim s_array() As String = Split(mstr, "00")
''byte to HEX
If UBound(s_array) > 0 Then
Dim strTemp1 As New StringBuilder(Bytes.Length * 2)
For intIndex1 = offset To offset + count - 1
RaiseEvent LineReceived(Me, strTemp1.ToString)
RaiseEvent LineReceived(Me, mobjText.ToString)
mobjText = New StringBuilder()
Aug 04, 2017 07:14 AM|Eric Du|LINK
According to your description, as far as I know, I notice that you write code to create a new object in the if statement. So I suggest you add a breakpoint to check the code execute sequence. Check why it get a null value?