asp.net chat room

liunx

Guest
I'm trying to implement a chat room application in asp.net, and i want to place it as a part of online site, and i want to make the users able to talk to each others directly and synchronously, also i want to provide the ability for sending offline messages, and making friends list, Any Ideas for helping me??I'm trying to implement a chat room application in asp.net, and i want to place it as a part of online site, and i want to make the users able to talk to each others directly and synchronously, also i want to provide the ability for sending offline messages, and making friends list, Any Ideas for helping me??

what do you have so far?

-Takokay, here's what i got till now,I have 2 ways for development, but i don't know which one should i choose, first a simple chat engine which stores the messages in a hash table, and then make all users see all the messages stored in this table every second, and second another simple chat room which introduced to me the idea of using web services to get the messages and to know the status of the users, also I think that i must use DB to save the online messages, and the friends list so I have a MSSQL server and this is all what i got till now.Does this mean you will refresh the page every second?I've been thinking of implemeting something similar in future web apps. My idea so far revolves around utilizing AJAX and web services to send and retrieve messages.

It's really pretty simple, and 2 methods will take care of most of the work. 1 method for posting messages and 1 method for retrieving messages.

The post method takes the userID and the message, the message and userID are stored in the DB as well as a timestamp and an Identity value.

The retrieve method takes an optional identity value. The retrieve method will then select from the DB where the Identity column is > the identity argument passed to it. All of the selected messages are returned along with userIDs, identity values, and timestamps.

On the client side, the last identity value from the returned messages is stored in a variable and used during the next request. If no identity value is passed to the retrieve method, such as when a user first connects, then only the last identity value from the DB is returned to be used in subsequent requests.

This idea is still only in the brainstorming stage, except I have started using AJAX to make requests to web services with SOAP messages and then parsing the response SOAP message using the XMLDocument object to retrieve results.

Something of importance to note, you only want to make requests to web services which are on the same domain as the web page itself. Most browsers will not allow AJAX requests to other domains for security reasons. So, requests to <!-- m --><a class="postlink" href="http://YourLocalhostDomainName.com">http://YourLocalhostDomainName.com</a><!-- m --> from <!-- m --><a class="postlink" href="http://localhost">http://localhost</a><!-- m --> will not work, they both must be one or the other.Ajax is the way to go, but I would find some other method than using a database since I think the database would kill performance. Probably some sort of shared application hash table or something like that would be better.

Eric
 
Back
Top