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
"John Wright" <ri***********@hotmail.com> wrote in message
news:e#**************@TK2MSFTNGP11.phx.gbl...
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