How can I know if the message has been sent by Tcp Socket in C# without client reply?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you send bytes using the
Sendmethod of a TCP Socket, TCP ensures that all bytes are delivered to the recipient. If the bytes cannot be delivered, theSendmethod will throw an exception.Note, however, that a Socket may buffer some bytes before sending them, so even if TCP guarantees the delivery of the bytes, they might have not been sent yet when the
Sendmethod returns.Also note that a program cannot determine if a TCP connection is broken if it only ever calls the
Receivemethod. You have to send some data from time to time in order to check if the TCP connection is still working.