0

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:

  1. Receive text from the server.
  2. Send text to the server.

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

jtabuloc
  • 2,479
  • 2
  • 17
  • 33
Fluff
  • 89
  • 13
  • As you said, you don't have any code so this isn't really a valid question for Stackoverflow. Using google, the first result for "wcf client server example" gives http://www.codeproject.com/Tips/642296/Hello-World-Basic-Server-Client-Example-of-WCF which seems to be exactly what you... so not sure how good your search was. – SpaceSteak Jul 22 '15 at 11:44

3 Answers3

2

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.

raddevus
  • 8,142
  • 7
  • 66
  • 87
0

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.

Community
  • 1
  • 1
Anubis77
  • 102
  • 1
  • 6
0

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.

Mahesh Malpani
  • 1,782
  • 16
  • 27