C# .NET - TCP multi-client continous connection/data exchange
Asked By dantz
18-Nov-08 12:54 AM
Hi,
I am wondering how should I implement my multi client-server application.
When the connection of a client is established with the server and the
exchange was done, can I just retain the connection until the client initiates to disconnect?
Or just disconnect whenever a request/response was finished then establish a new connection again if it is needed
I am just concerned that if the connection will be continous it may be not a good choice because of network issues (bandwidth,security or anything) or client machine issues (memory,local resource or anything)
I hope anyone can help me on this.
TIA- Dan
re
u right the connection should be disconnect when request/response was finished because unusual load is bothering .
reply
thanks lalji
thanks for the comment arvind.
The link was very helpful, that can help me implement it.
But I still need some suggestions on which is better:
continously alive connection or just a frequent reconnection?
how does multi player games implement it?
does anyone have an idea? does the connection always alive until the game finish?
re
just a frequent reconnection is better option
reply
Thank you for the suggestion.

one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B)What is a difference between VB.NET and C#? (I) what is the difference between System exceptions and Application exceptions? (I)What is CODE Access security? (I)What is a satellite assembly? (A) How Daemon threads and how can a thread be created as Daemon? (A) How is shared data managed in threading? (I) Can we use events with threading? (A) How can we know the difference between thread and process? Chapter 4: Remoting and Webservices (B)What is an application domain? (B) What is .NET Remoting? (B) Which class does the remote object has to fundamental of published or precreated objects in Remoting? (A) What are the ways in which client can create object on server in CAO model? (A) Are CAO stateful in nature? (A) To create objects in CAO be done? (I) Is it a good design practice to distribute the implementation to Remoting Client? (A) What are LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime? (A) Which config file has all the consume it? (A) Do webservice have state? Chapter 5: Caching Concepts (B) What is an application object? (I) what is the difference between Cache object and application object? (I) How can
Web Service? 10) What is the difference between ADO and ADO.NET? 11) What is connection pooling ? 12) What is the difference between an EXE and a DLL? 13)How do Activex component in to .NET? 1) HttpHeader will useful for the browser protocol. It preserves data between different HTTPRequest such as Get() and Post() . 2) Session.abandon() , Session.clear() , etc. 3) Using length property of Array. 8) If we r using the Globalization in our application. Then we need to create .dll file. It uses resource file. We need to convert two files as : resgen.exe and al.exe. 9) Web Service will run on web server. It is always active on the web service. We can use that system in our application. Web Service use SOAP Protocol . It sends data in XML Format . 11) If connection pooling is activated then we can use that active connection . So, there is no need to connect again to the database server. 12) .EXE is
ASP.NET. We will continue to add content to this article over time and in response to questions. ASP.NET Cookies Overview Cookies are associated with a Web site, not with a specific page, so the browser and server will exchange cookie information no matter what page the user requests from your site. As the user of up to 4096 bytes. THerefore, cookies are best used to store small amounts of data, or even better, only an identifier such as a user ID. This user ID can be used to identify the user and read user information from a database or other data store. In the case of Forms Authentication, the Forms cookie can store its own expiration This can eliminate the need to use Session to store small amounts of user-specific data. Forms auth cookies are normally encrypted. Cookie data can be compressed to allow storage of entire classes in .Net. Browsers impose limitations on liner that you can put into your page base class or master page: HttpContext.Current.Response.AddHeader ("p3p", "CP = \ "IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS
Text; usercredentialsCookie.Values["userpassword"] = txtPassword.Text; / / set an expiry usercredentialsCookie.Expires = DateTime.Now.AddDays(10); Response.Cookies.Add(usercredentialsCookie); There are many ways to communicate and store data from front-end to back-end, but many require AJAX which may take too much time to develop or might not fit the project correctly. A neat alternative to save data and be able to access that data from the server is using browser cookies . Cookies can be created and destroyed by javascript, and while the user preferences or other information. When the user visits your Web site another time, the application can retrieve the information it stored earlier. This article provides an overview of working with small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information the Web application can read whenever the user visits the site. Imagine that when users request a page
server client hi. . .can u please explain what is server, client, web browser and web server and the commmunication between this. . . I learnt but still i am in confusion. . . please explain in simple words. . .thanks in advance Ever wondered the what is the difference between client side code and server side code? If your answer is YES, this chapter is for you. Server side code When you request a page, the web server executes the code in the