• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

Winsock Doesn't Send Data

Following is my Code used to send the Data from Server to Client.

Private Sub wsSocket_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim sItemData As String
Dim strData As String
Dim strOutData
Dim strConnect As String
Dim mRep
Dim mRecordCount As Double

' get data from client
Me.wsSocket(Index).GetData sItemData, vbString
mRequestNo = Val(sItemData)
sServerMsg = "Received: " & mRequestNo & " from " & Me.wsSocket(Index).RemoteHostIP & "(" & sRequestID & ")"
Me.Text1 = " "
Me.Text1 = sItemData 'This is the SQL Query send by Client
Call subExecuteQuery 'It executes the Query and creates recordset(mRSTemp)

mRep = Split(mRSTemp.GetString, Chr(13))
mData = ""
For i = LBound(mRep) To UBound(mRep)
    wsSocket(Index).SendData mRep(i)
    mRecordCount = mRecordCount + 1
Next
end sub

Here the query is received by server and it is executed, even the loop is also executed but the client is not able to receive the data from the statement for sending data in For Loop. Kindly guide why SendData command is not being executed within loop.

If i am sending the whole recordset as one buffer say of 60000 bytes the client is receiving only 1800 bytes. why?

Thanks
Hiren
0
hiren_d_in
Asked:
hiren_d_in
  • 2
1 Solution
 
y2kswCommented:
wsock sends only strings or byte arrays, no variants.
0
 
a3b2c1r46Commented:
Winsock is limited in the amount of data it will transfer at once usually the MTU of the network (ethernet around 1500 bytes). You will have to have the server loop through the data sending it a chunk at a time and have the client rebuild it.
0
 
GPrentice00Commented:
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I would appreciate any comments by the experts that would help me in making a recommendation.

It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0
 
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept a3b2c1r46's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now