Hi All,

I am trying to use the Asynchronous Server Socket Example from MSDN (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconnon-blockingserversocketexample.asp )
in my C# windows form application.

Clients will connect and send a data packet. This server program has to
receive packets from multiple clients and relay those packets to another
server for further processing.

In ReadCallBack function instead of doing Console.WriteLine, I want an event
(
Message ) to be sent to the mainform along with the data. So that the
Mainform can send this data to other server through already open socket.

How can I send (post) event/Message along with the data to the Mainform?

Thanks in advance,
Ravi

Re: Asynchronous Server Socket Example by Lee

Lee
Wed Nov 26 15:56:20 CST 2003

Your callback will be in a different thread of execution than the main
form message pump? The message needs to be marshaled back to the main
form thread, and then sent. MS has examples. I've found this tricky
to do generically, in a component, but it can be done.

HTH - Lee

"Ravi" <koppular@hotmail.com> wrote in message
news:uUDI5QGtDHA.700@TK2MSFTNGP11.phx.gbl...
> Hi All,
>
> I am trying to use the Asynchronous Server Socket Example from MSDN
(
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconnon-blockingserversocketexample.asp )
> in my C# windows form application.
>
> Clients will connect and send a data packet. This server program has
to
> receive packets from multiple clients and relay those packets to
another
> server for further processing.
>
> In ReadCallBack function instead of doing Console.WriteLine, I want
an event
> (
> Message ) to be sent to the mainform along with the data. So that
the
> Mainform can send this data to other server through already open
socket.
>
> How can I send (post) event/Message along with the data to the
Mainform?
>
> Thanks in advance,
> Ravi
>
>
>
>