i am beginner for WCF. so i was reading a code online for small wcf chat.i got stuck to create wcf client for that wcf chat. the url from where i was reading http://islameldemery.blogspot.in/2008/05/wcf-serverclient-chat-sample.html
there is one part for interface and service is hosted in win form with the help of ServiceHost but i am not being able to understand how proxy was created at client end.
they use this event below
InnerDuplexChannel.Opened
InnerDuplexChannel.Closed
InnerDuplexChannel.Faulted
which i really do not understand. can anyone tell me how the client was created. please visit the url and please tell me how that person create a proxy at client side for that chat service.
i tried to create a proxy dynamically like self hosted as
var myBinding = new NetTcpBinding(SecurityMode.None);
DuplexChannelFactory<ISampleChatCallback> cf =
new DuplexChannelFactory<ISampleChatCallback>(
new CallbackImpl(),
myBinding,
new EndpointAddress("net.tcp://192.168.1.2:8080/DataService"));
IServerWithCallback srv = cf.CreateChannel();
but srv has no event called Opened,Closed or faulted etc. i really need to understand how proxy was created at cleint end. please help me to create proxy as a result i can complete the code for client side. thanks
Have a look at the
private void buttonConnect_Click(object sender, EventArgs e)The
proxyexposes some events that (I suppose) are just wrappers of the WCF duplex channel communication class (whatever it is). Those events get fired when a new connection is opened, closed or appears in a faulted state.