ASP.NET Chat

J

John Wright

I am trying to create a very simple chat program using UDP through a web
page. I am having problems getting this going. All the examples I've seen
deal with remoting or application variables, or web services, etc. Does
anyone have any resources to point me to (either VB.NET or C#) that explains
how to create a simple chat on a web page?

thanks.

John
 
B

bruce barker

a web page can not use UDP. you must supply a java applet, active/x control
to do this. if you meant for the server to be a proxy for the chat client
(talking to an internet chat), then you will need to spin up background
threads that maintain the ip connections used by UDP, and set up some
communication system between the connection managers and the aspx pages.

-- bruce (sqlwork.com)
 
D

Dale

The problem with chat and the web is that the connection is not held between
page requests. There's no way to send a message to the intended recipient
unless the client requests the page by specific action of refreshing or
submitting the form.

You can hold messages in a database or even MessageQueue and update the
client on refresh or on postback or there is another way I have used.

I created a frames page, the client sends messages from one frame and in the
other frame receives all messages intended for him. The page for the
incoming messages frame is created with a class derived from IHttpHandler
and IRequiresSessionState. I use a timer and a loop to keep the response
object from completing so the connection between the client and server
remains open and messages can be sent to the client as required. To prevent
client timeouts, I Response.Write and empty string every minute.

Another great chat starting point, and the starting point from which I
developed a full function encrypted WindowsForms client/server chat system,
is the DelegatesAndEvents example in the samples provided with the
framework.

There's also a TcpUdp chat example in the framework samples but I don't like
it as much as the DelegatesAndEvents sample.

Dale Preston
MCAD, MCSE, MCDBA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top