Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sending while the send is processing  (Read 2117 times)

0 Members and 1 Guest are viewing this topic.

lorence30

  • Full Member
  • ***
  • Posts: 124
    • View Profile
    • Email
sending while the send is processing
« on: November 03, 2015, 10:38:25 am »
in a chat app, using tcpSocket what will happen if the previous message is still in the process of sending and the client sends a new message, does the new message will be disregard? or it will queue and wait until the previous message sent

can you answer it in nonblock and blocking mode ?

TIA
« Last Edit: November 03, 2015, 10:43:35 am by lorence30 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sending while the send is processing
« Reply #1 on: November 03, 2015, 11:27:25 am »
What about properly documenting yourself about the TCP protocol? ;)

SFML sockets are a very thin wrapper around system sockets. So you won't find answers to your questions in the SFML doc nor on the SFML forums. You should rather find some good documentation about TCP/UDP sockets if you don't want to struggle with network programming.
Laurent Gomila - SFML developer

lorence30

  • Full Member
  • ***
  • Posts: 124
    • View Profile
    • Email
Re: sending while the send is processing
« Reply #2 on: November 03, 2015, 01:01:50 pm »
i see, i get your point, my question is about a tcp protocol

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sending while the send is processing
« Reply #3 on: November 03, 2015, 03:23:59 pm »
There's one thing that can happen independently of the TCP protocol itself: if you overflow the internal buffer of the socket, and your data is rejected before TCP even sees it. In this case you must use the new function in sf::TcpSocket that allows partial send. See the documentation for more details.
Laurent Gomila - SFML developer