Asycn TCPListener Sample Stops Listening URGENT!!!

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by MSDN » Wed, 03 May 2006 21:30:22


I have created a Sockets Sever using the MSDN sample here
http://www.yqcomputer.com/

The problem is when I disconnect a client the server seems to stop listening
any ideas would be greatly appreciated.

Thanks Chris
 
 
 

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by Helge Jens » Thu, 04 May 2006 01:13:36


The AcceptCallback doesn't restart the Accept.

BTW: the examples in MSDN aren't all that good to start with, you should
seek a second opinion on how to do async-programming (and a third for
that matter :) it's *hard* to get right.

--
Helge Jensen
mailto: XXXX@XXXXX.COM
sip: XXXX@XXXXX.COM
-=> Sebastian cover-music: http://www.yqcomputer.com/ <=-

 
 
 

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by MSDN » Thu, 04 May 2006 03:02:13

Can you please give an example of how to Restart the Accept?
And any other good samples for that matter?

Thanks in advance.
Chris
 
 
 

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by Helge Jens » Thu, 04 May 2006 03:46:17


Reinvoke BeginAccept, otherwise noone will be listening.


I known how I like it ;)

Something along the way in EchoServer<T> and (by analogy) Parrot<T> at
https://slog.dk/svn/home/jensen/source/msgio/trunk/msgio/Program.cs, and

That code isn't a tutorial, but it is an example of some (I think :)
very robust code using async-programming. It certainly doesn't crash
when running the test, which opens and closes stuff all the time.

--
Helge Jensen
mailto: XXXX@XXXXX.COM
sip: XXXX@XXXXX.COM
-=> Sebastian cover-music: http://www.yqcomputer.com/ <=-
 
 
 

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by MSDN » Thu, 04 May 2006 04:35:54

What references do you have in your sample project
I am getting errors with the IChannel
 
 
 

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by MSDN » Thu, 04 May 2006 04:59:29

Diregard Thanks!!!
 
 
 

Asycn TCPListener Sample Stops Listening URGENT!!!

Post by William St » Thu, 04 May 2006 06:29:05

Moreover, there is really no compelling reason to do Accept async. Just
have one listener thread that does Accepts sync, and go async after that.

--
William Stacey [MVP]



|
|

| > Can you please give an example of how to Restart the Accept?
|
| Reinvoke BeginAccept, otherwise noone will be listening.
|
| > And any other good samples for that matter?
|
| I known how I like it ;)
|
| Something along the way in EchoServer<T> and (by analogy) Parrot<T> at
| https://slog.dk/svn/home/jensen/source/msgio/trunk/msgio/Program.cs, and
|
| That code isn't a tutorial, but it is an example of some (I think :)
| very robust code using async-programming. It certainly doesn't crash
| when running the test, which opens and closes stuff all the time.
|
| --
| Helge Jensen
| mailto: XXXX@XXXXX.COM
| sip: XXXX@XXXXX.COM
| -=> Sebastian cover-music: http://www.yqcomputer.com/ <=-