Jump to content
  • Advertisement

tom_d1

Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

102 Neutral

About tom_d1

  • Rank
    Newbie
  1.   I am working at the application level, that is, I am using sockets and not controlling the TCP packets themselves (which can only be done in raw sockets I suppose).           When I say "send a RST", this means that I want to close the connection ungracefully, which means that when I close the socket, the socket will remove all of its data (send buffer, receive buffer, etc.) and sends an RST packet to the other end telling it that it is no longer there.   But when I say "send a FIN packet", this means that I want to close the connection gracefully, which means that when I close the socket, all of the data in transit and in the send buffer will be sent to the other end (followed by a FIN packet), and all of the data from the other end in transit and in its send buffer will be sent (followed by a FIN packet also). Which as I have said earlier is a bad idea if I want to abort a file transfer immediately, because it could take a long time for the pending data to arrive before the connection is closed.         Yes, this is the only approach that makes sense.   BTW, I am working under Windows.
  2.   I assume you mean it should close the socket that is receiving the file. When the socket wants to gracefully close the connection, it would send a FIN packet to the other end, now the other end will also send its own FIN packet, which like I said earlier will only get processed by the other socket when the packets in transit and in the send buffer has been fully received by the other socket, which doesn't solve the problem (unless I misinterpreted what you mean).   Note that I think I will go with the RST approach, however I'm curious to understand this other approach.
  3.   Let's say I did that, now I am sending a file through the first socket, and after a while I decided to abort the file transfer, so I send the string "file transfer aborted" through the second socket and then this string is received by the other end, what should the other end do now?
  4. I am sending a file from one socket to another, and there are a lot of packets that are now in transit and in the socket send buffer. What I want to do is to abort the file transfer immediately (once the user clicks "Abort", the file transfer is aborted without any delay).   If I closed the connection gracefully (by sending a FIN packet), then the FIN packet will only get processed by the other socket when the packets in transit and in the send buffer has been fully received by the other socket (which could take a long time).   I think that the only way to do this is to close the connection ungracefully (by sending an RST packet). Am I correct or is there another way?
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!