Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

[VB-6] Microsoft Winsock Control 6.0 SP6 getData returns additional characters

$
0
0
Simply put, the getData command I am using adds one or two extra characters to the end of any message.


Code in the client for receiving messages
Code:

Private Sub LAN_DataArrival(ByVal requestId As Long)
    Dim msg As String
    LAN.GetData msg, vbString

Server code for sending the tagged message as well as the message immediately after
Code:

Handler.SendData ("=+\\RD//+=")
Handler.SendData (ClientData(0).port)

ClientData is a User-Defined Datatype and the code behind it is this, in case it is important:
Code:

Private Type ClientData
name As String
IP As String
port As Long
ID As Integer
use As Boolean
End Type

When I use a msgbox to display the text to debug it the result usually is "=+\\RD//+=}õ" (without the quotes, and the last 2 characters tend to change but that has been the most recent result.)
I honestly can say I have no idea what this could be caused by.
My Winsock control is using the TCP option (sckTCPProtocol) and has an index of 0 (since I'm using the Load command to launch multiple instances.)
The only thing that could be happening that honestly seems like a stretch is that it is combining two messages into one, but I don't see why it would do that.

If there is any code might be the cause don't hesitate to ask me to post it (but you will be disappointed by the organization of it.)

Thanks,
Dunii

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>