Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > Checking received data length of winsock??


Reply
 
Thread Tools Display Modes
  #1  
Old 04-22-2003, 09:04 AM
Steven_Teo Steven_Teo is offline
Newcomer
 
Join Date: Apr 2003
Posts: 8
Unhappy Checking received data length of winsock??


Hi,

I'm using Winsock to connect to a server and have to supply a valid password and user ID for a successful connection. I want to implement some error checking capability to my program. When my passwords and user IDs are valid, I will start to receive some data but when they are invalid, I will not receive any data. Is it possible to check the data length of my received data so that I can do something like this

if received data length = 0, generate error message and prompt user to try connecting again.

if received data length > 0, save the data to a file and display in a textbox.

Can I check/determine the data length of the data I receive from winsock? Is it some how related to winsock events. I'm very very new to VB especially with the winsock thing. Hope you guys can give me some clues and help on this small problem of mine ... thanks
Reply With Quote
  #2  
Old 04-22-2003, 09:08 AM
GMan_NC's Avatar
GMan_NC GMan_NC is offline
Proud Daddy

Forum Leader
* Expert *
 
Join Date: Sep 2002
Location: North Carolina, USA
Posts: 1,962
Default

This event fires when data is received. bytesTotal is the number of bytes received
Code:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) End Sub
__________________
A morning without coffee is like something without something else.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Winsock receiving corrupt data PetCar Communications 2 04-19-2003 02:51 PM
Problem displaying Data from Winsock Steven_Teo Communications 2 04-10-2003 05:31 AM
how can I wait until winsock is connected and data is received margant Communications 2 08-12-2002 03:23 PM
Sending excessive amounts of data via winsock. Mikirin Communications 11 06-06-2002 02:49 PM
Winsock SendData, sends data twice at once TerryHau Communications 1 05-27-2002 12:38 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->