ASP.NET 开发聊天室程序(英文)
来源:互联网 发布:mac装win10黑屏 编辑:程序博客网 时间:2024/05/16 01:24
ASP.NET 开发聊天室程序(英文)
Introduction:
In its new avatar, ASP has undergone a metamorphosis. It is no longer confined to simple server-side scripting. It is no more mere bits of HTML contents or data inserted into template HTML code. With it, you can create a full-fledged web application, on the fly, with control over several critical factors.
Anyway, you may ask, what is the difference between a web application and a web page? In server side scripting your role is limited to, and ends with, the rendering of the web page on the client's browser, save that, you can maintain some control over the session and session related variables. On the other hand, for a web application, you approach the whole affair differently - the server is where the action takes place and the page is no longer a simple HTML document. Instead, the web page is a frame on which you create an interactive session between you and the client or between clients among themselves. You compose it from scratch placing elements at the appropriate places, wiring up event handling, storing variables not only for the session state but also for the application state and most importantly controlling flow of information between client and server and from client to client.
The last mentioned ability makes an ASP.NET application into a Peer 2 Peer Networked Application. This article will present you with one such Peer 2 Peer networked application in the form of a Chat application.
Charting the course for chatting
How do you create a Chat Application? Traditionally, for a chat application, you have to create a server side listener, which requires a server side TCP/IP channel and listens for requests from clients. These requests can be of two types:
Registering a new chat participant
Passing on chat messages to other chat participants.
In addition, the server-side program gets a handle to the client object and uses this handle to update chat messages of the participants as well as the list of participants at any given time.
However, in this ASP.NET application, the problem of the Server-side listener can be side stepped, as ASP.NET itself will be the listener. Thus there is no hogging of a TCP/IP channel for a dedicated listener. Since an ASP.NET Application uses the HTTP Protocol and the corresponding Port 80, it is not affected by most of the firewalls, unlike a dedicated chat listener. The HttpApplicationState State Object, provided to us by the NET Framework, solves the problem of sharing information across applications. The options available to us in this regard are:
The HttpApplicationState Object,
The System.Web.Caching.Cache object,
Database back end
The Isolated Storage Dump.
Whilst the last two options involve Read/Write/IO operations, they are not suitable for a simple chat application where the speed is the essence and there is no great amount of memory involved. The cache object does not provide for locking and may affect synchronization when several users access the page at the same time. Hence, we zero in on the HttpApplicationState object for our data storage. Finally we handle the trickiest question of pushing messages from the server to the client using the web services behavior of Internet Explorer 5.0 and above
There is also no need for support staff starting or ending an application. ASP.NET acts as the master application and is expected to keep going as long as the IIS is running on the Server.
- ASP.NET 开发聊天室程序(英文)
- ASP.NET 开发聊天室程序(英文)
- ASP.NET 开发聊天室程序(英文)
- asp.net聊天室小程序练习
- ASP.net--简易聊天室
- asp.net 在线聊天室
- 用Asp.Net创建基于Ajax的聊天室程序
- 用Asp.Net创建基于Ajax的聊天室程序
- 用Asp.Net创建基于Ajax的聊天室程序
- 用Asp.Net创建基于Ajax的聊天室程序
- 用Asp.Net创建基于Ajax的聊天室程序
- 如何使用ASP.NET开发基于推技术的聊天室?
- asp.net之简易聊天室
- ASP.NET MVC4异步聊天室
- 介绍几个免费的英文ASP.NET的CMS程序
- asp.net英文文献
- ASP.NET 使用application与session对象写的简单聊天室程序
- Asp.net MVC4 + signalR 聊天室实现
- asp.net生成缩略图
- 从网页上下载控件时制作CAB包的方法
- 内网ip映射到外网,利用80端口映射发布网站,利用全端口映射外网访问内网应用
- 用设计模式开发通用数据库操作器
- html编辑器中得到系统的字体
- ASP.NET 开发聊天室程序(英文)
- 个人赛 A 题 传球游戏(ball)
- 常用的数据库访问方式
- 关于INDEX SERVER+ASP建立查询引擎的一点心得
- 用户体验,我们需要注意哪些细节
- HQL语句详解
- C#的索引器
- 对提高ASP执行效率的几点看法
- ruby 多继承 mixin include exclude require load