473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with the Microsoft Asyncronous TCP Server Implementation Example.

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-blockingserversocketexample.asp) 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,portConnect);

Stream stm = tcpclnt.GetStream();

ASCIIEncoding asen= new ASCIIEncoding();

byte[] StrOut =
asen.GetBytes("0157SITE01220000001681E611E1C633907 06141214
00005535<PedTables><TABLE><R
MESS=\"1\"NAME=\"STATE\"></R></TABLE></PedTables><EOF>");

stm.Write(StrOut,0,StrOut.Length);

stm.Close();

tcpclnt.Close();

Thread.Sleep(100);

}

catch (Exception e)
{
Console.WriteLine(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***********@arnet.com.ar
MSN: an***********@hotmail.com (I will waiting here...)


Jul 21 '05 #1
0 1076

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
1
by: alex002 | last post by:
Dear all, I am writing to a C# program to connect to the telnet server and getting data; however, I know that I can use either TCPClient and Asyncronous Socket to do the program. However, I...
4
by: waltborders | last post by:
Hi, Because the blind are unable to use a mouse, keyboard navigation is key. A major difficulty is that not all windows forms controls are keyboard 'tab-able' or 'arrow-able' or have "tab...
10
by: Saso Zagoranski | last post by:
hi, this is not actually a C# problem but since this is the only newsgroup I follow I decided to post my question here (please tell me where to post this next time if you think this post...
0
by: Andrés Joaquín | last post by:
Hello, I have a problem with a TCP Asyncronous Server Implementation. I take the solution from the Microsoft Site (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
7
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports...
3
by: OJ | last post by:
Hi, I have written a small C# 2.0 DLL which acts as a client to a Socket based server over the internet. I have written both synchronous and asynchronous methods to connect, send, and receive data...
1
by: -pb- | last post by:
Hi, Is it possible to develop a web service which can send asyncronous notification to the client application using Web Service and not the Remoting? What I really want to know that, if each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.