Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server sample stops sending of data #58

Open
ddobric opened this issue Jun 22, 2017 · 3 comments
Open

Server sample stops sending of data #58

ddobric opened this issue Jun 22, 2017 · 3 comments

Comments

@ddobric
Copy link

ddobric commented Jun 22, 2017

I have slightly changed the server sample application to continuously send the data to accepted connection.

                           while (true)
                            {
                                await writer.WriteLineAsync(DateTime.Now.ToLongTimeString());                               
                                Thread.Sleep(N);
                            }

After a while, server simply stops sending of data to that connection. I have also changed the version of server to prevent buffer overflow of the Console application, which might happen if too many data is written in the console output.
When server stops writing, there is no any error indication.

While the same instance of the server (and client) is running (no more data exchange), I start next client. After a while server stops again sending of data to that client too.

@danny8002
Copy link

maybe this is because 'buffer' issue in writer, you can see #57 , and try to write data directly by using Stream.

@dlstucki
Copy link
Contributor

dlstucki commented Oct 29, 2019

I agree the buffering could contribute. Add a call to Flush[Async] before the sleep/delay. However, I don't have full confidence that will make your issue work properly. What is the thread.sleep duration? (Also, use await Task.Delay(N) instead of Thread.Sleep to free up threadpool threads).

@jfggdl
Copy link

jfggdl commented Jan 27, 2020

@ddobric, are you still experiencing an issue? Please let us know how else we can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants