[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

sending long data through winsock

Posted on 2004-08-02
7
Medium Priority
?
176 Views
Last Modified: 2013-11-13
I want my program to be able to send long data through winsock in packets of 3000 bytes.
My code is constructed of:

strData - Date to send through winsock

If Len(strData) > "4000" Then
split the data here so it sends 4000 bytes then it checks again to see if its over 4000 and so on. therefore a loop will be added...


What is the code to tell use that the winsock is finished sending the first packet so we can move onto the next?
Thank you for your time
0
Comment
Question by:doyledom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 300 total points
ID: 11694552
You can send a packet size field before your actual data, so your receiving function reads it first and prepare to read sized data.
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 300 total points
ID: 11695900
The other method is to attach a special character or sequence of characters to the end of each packet to indicate that more is coming.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 11697936
If I remember correctly there's no guarantee of the order in which packets will be delivered.  You might need to send a packet telling the distant end to expect x number of additional packets and then have it send a reply back acknowledging that before you begin sending the real data packets.  Just a thought.  I haven't used Winsock a lot, but enough to know that it doesn't always behave as you might expect.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11697980
>If I remember correctly there's no guarantee of the order in which packets will be delivered.
This is in case of using UDP frames (author has not specified frame type)

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question