SendData method for winsock control 6.0 
Author Message
 SendData method for winsock control 6.0

I am currently developing in Visual Basic 6.0 and have come accross a
problem using SendData.
I am using Windows CE on the client computer and Windows2000 for the server.
Here is some sample
psuedo code and the undesired result.

CLIENT computer's code:

Private Sub cmdSendMessage_Click()

frmConnect.WinSock1.SendData "BillyGoat"        // Sends "BillyGoat" to the
server computer

End Sub

SERVER computer's code:

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

Dim strData                              // data (as a string) that has been
sent by client
Winsock1.GetData strData       // data sent by client is loaded into strData
Dim Message
Message = MsgBox("strData= " & strData, vbOKOnly)

End Sub

The result of this code is two message boxes.  The first will display:
strData= B
The second message box will display:  strData= illyGoat

Apparently SendData breaks off the first character and sends it.  Then sends
the rest of the
string.  I want to know why this happens, if it is supposed to happen, and
how to send and receive
the entire string as a single block of data.  Thanks.



Sat, 30 Nov 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. senddata method problem in winsock control

2. how to send structures in winsock senddata method?

3. Winsock Senddata method - confusing?!

4. Winsock Senddata method - confusing?!

5. SendData and Winsock control collection ?

6. winsock problem sending large strings (winsock.senddata)

7. SendData and Winsock control collection ?

8. Winsock control SendData() doesn't if ConnectRequest received

9. Winsock control - SendData

10. Winsock.SendData yields control to the OS in TCP mode

11. winsock senddata problem/question

12. Weird thing with Winsock.SendData

 

 
Powered by phpBB® Forum Software