Hello,
I have a problem with a TCP Asyncronous Server Implementation.
I take the solution from the Microsoft Site
(http://msdn.microsoft.com/library/de...-us/cpguide/ht
ml/cpconnon-blockingservers ocketexample.as p) and implemented it but when i
test it I get problems...
I used the below test client code to test the Syncronous Server but after a
while (sometime 5 minutes, sometimes 10 minutes, sometimes 1 hour and
sometimes more) the server stop to respond Client Connect requests.
I debug the server code and I find that the Server get locked in the While
loop of the StarListening Sub (you can see the Server code in the link
above).
class Client
{
[STAThread]
static void Main()
{
do
{
string ipConnect = "127.0.0.1" ;
int portConnect = 11000;
TcpClient tcpclnt = new TcpClient();
try
{
tcpclnt.Connect (ipConnect,port Connect);
Stream stm = tcpclnt.GetStre am();
ASCIIEncoding asen= new ASCIIEncoding() ;
byte[] StrOut =
asen.GetBytes(" 0157SITE0122000 0001681E611E1C6 3390706141214
00005535<PedTab les><TABLE><R
MESS=\"1\"NAME= \"STATE\"></R></TABLE></PedTables><EOF> ");
stm.Write(StrOu t,0,StrOut.Leng th);
stm.Close();
tcpclnt.Close() ;
Thread.Sleep(10 0);
}
catch (Exception e)
{
Console.WriteLi ne(e.ToString() );
}
} while (true);
}
}
Any idea to help me? What can I do to unlock the Server?
Thanks in advance and sorry for my poor English. I'm from Argentina.
Andrés
Mail: an***********@a rnet.com.ar
MSN: an***********@h otmail.com (I will waiting here...)