CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

Thread: sending and receiving file from socket

  1. #16
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,116

    Re: sending and receiving file from socket

    Mike,

    I have lng disagreed with the "guarantees" of TCP. Primarily from a syntactical point of view.

    Consider an application pair where the sender transmist 1MB over a slow complex routing scheme. At some point in time the receiver begins getting data. We wait until 500KB has been received, then do something "nasty" link crash the network, or event the receiving application.

    Clearly not all of the data will be received. Thus (as phrased by you and many others), the "guarantee" is not met.

    I (and many others) prefer that the syntax be reversed (and it is in many publications to be:

    TCP guarantees that no bytes will be duplicated or dropped from the middle of the stream, nor will any bytes be received out of order.

    Sounds silly, but you would be suprised the number of people I have run across who will do a "blind send" of data over TCP and do NO checking because "TCP guarantees reliable delivery"....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  2. #17
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: sending and receiving file from socket

    That's a fair criticism of the way many people (myself included) have described the guarantees of TCP. As you say, delivery is not guaranteed. Rather, there is only a guarantee that if any one byte is received, that all bytes before it have already been received without duplication.

    Mike

  3. #18
    Join Date
    Nov 2011
    Location
    India
    Posts
    314

    Re: sending and receiving file from socket

    Quote Originally Posted by Igor Vartanov View Post
    See the sample.
    Hi,

    Can i send any files (SFTP) ?
    Regards,

    SaraswathiSrinath

  4. #19
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,144

    Re: sending and receiving file from socket

    As this thread is nearly 13 years old, I suggest you start a new thread detailing your specific issue.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.6.3)

  5. #20
    Join Date
    Nov 2011
    Location
    India
    Posts
    314

    Re: sending and receiving file from socket

    Quote Originally Posted by 2kaud View Post
    As this thread is nearly 13 years old, I suggest you start a new thread detailing your specific issue.

    Ok. Thank you.
    Regards,

    SaraswathiSrinath

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)