Hello,
I've been using vb6 for a few month now and have experienced some problems using winsock.
I have a function for sending data from the server like this:
VB Code:
Function SendData(Index As Integer, Data As String) frmServer.ServerSck(Index).SendData & "%$" End Function
when the server recieve data I pass it to a function for proccessing the data, somthing like this:
VB Code:
Function ProcData(Index As Integer, Data As String) Dim DataA() As String Dim DataPacket As String Dim DataPacketA() As String Dim i As Integer DataA() = Split(Data, "%$") 'Split up the incoming commands For i = 0 To UBound(DataA) - 1 If DataA(i) <> "" Then DataPacket = DataA(i) DataPacketA() = Split(DataPacket, "|") 'Split the paramaters Select Case LCase(DataPacketA(0)) Case "login" 'I would call the login function here End Select End If DoEvents Next i End Function
when I call my login function it all works fine till it gets to the senddata calls, at the end of the function. I have lots of calls to other functions that in turn use the sendData function to send appropriate data, kind of like this:
VB Code:
Call SendData Index, "Data" Call Function1 Index Call Function2 Index Call SendData Index, "Data2" Call Function3 Index
My problem is when it gets to all those calls it never sends everything it should. I tried using doevents and it fixed some of them, but usual led to it working somtimes and not others. I've read that using doevents can cause problems later on in development.
I also use a encryption class before sending the data if that would make any difference in data being sent or not.
Can anyone help?
If anyone needs more info or to see more of my code I'll be happy to post it.
Also the server is used for a custom mud.
Any help is appreciated.
Thanks




Reply With Quote