Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


VB6 Winsock Problem

This topic is 5858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi This is Kinda stupid but I'm trying to send a file using the Winsock control and this is how im doing it: ============================================== 'VB6 code Dim FileData As String Open FileName For Binary As #1 'the file which to be send FileData = Space$(LOF(1)) Get #1, , FileData Winsock1.SendData FileData DoEvents Close #1 ============================================== And I receive the file like this ============================================== Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long( Dim FileData As String Winsock1.GetData FileData, vbString DoEvents Open "C:\recived file" For Binary As #1 Put #1, , FileData Close #1 End Sub ============================================== Could some one please tell me what I am doing wrong, most of the time I end up with a corrupted file!!!!!!!! Thanks in advance [edited by - fma on June 7, 2002 4:41:27 PM] [edited by - fma on June 7, 2002 4:42:26 PM]

Share this post

Link to post
Share on other sites
The VB Winsock OCX breaks up large packets into 8KB chunks.

Output the size of the data being recieved to verify it''s the same as the file that was sent.

Instead of writing to a file, setup a multi-line text box and append the data you recieve to it.

The first rule of effective debugging is to output relivent variables to either a log file or the screen.


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting ]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!