Reputation: 89
I am trying to make a client/server chat application and I have been searching the internet for about 3 hours but I can't find any good examples. The service should not be P2P instead it should connect to a server within the same network.
What the client should do are the followings:
I am happy to get any reference or even a better sample codes. (And no I don't have any code yet.)
Edit: It should not be web based
Upvotes: 0
Views: 1741
Reputation: 1989
If without database you want, then WCF service should Persession or Single instance mode. Since per call will create new instance and chat will not be persists. Here you can use local variable in service and append in sendChat() like method
If with database then you need to write your own logic.
Upvotes: 0
Reputation: 142
I would suggest that you look at basic TCPIP communication first and then design your GUI to capture the user input.
example of tcpip communication :
Sending and receiving data over a network using TcpClient
When you can successfully transfer data from a client program to a server and back then you can connect that up to a Gui.
Upvotes: 0
Reputation: 9077
This is a very large question. First it is about WCF -- a huge subject. But then it's about writing a chat client -- another large subject.
The more you know about implementing a chat client the better so one of the easiest ways to implement one is using Firebase API.
Fortunately you can see a great working example at: https://firechat.firebaseapp.com/
THe code is totally open and you can examine how it works at: https://github.com/firebase/firechat
After you look at that, you will understand far better how to turn code like that into a WCF application. You'll be way ahead of the game. Good luck.
Upvotes: 2