• (3 Pages)
  • +
  • 1
  • 2
  • 3

A simple Chat program with Client/Server (GUI optional) Rate Topic: ***** 2 Votes

#31 Prakash2003  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-May 13

Posted 06 May 2013 - 04:01 PM

Thanks for the wonderful example. I got a question on the Server Program.

When i tried to run the Server with the below 2 lines jumbled it is not working. The Server or Client are not responding. They simply stuck.

 
// create output first
sOutput = new ObjectOutputStream(socket.getOutputStream());
sInput = new ObjectInputStream(socket.getInputStream());



Why should we create the ObjectOutputStream First. How does that make difference.

Thanks
Prakash
Was This Post Helpful? 0
  • +
  • -

#32 Arkar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-April 13

Posted 10 May 2013 - 09:55 PM

Welcome to the Chat room
Connection accepted /149.171.37.231:80
Exception creating new Input/output Streams: java.io.EOFException
Connection accepted /149.171.37.231:80
Exception creating new Input/output Streams: java.io.EOFException
Connection accepted /149.171.37.231:80
Exception creating new Input/output Streams: java.io.EOFException



Hi,
would you please explain why this massage is popped out while trying to connect to the particular server running in "C".

what sort of necessary steps do I need to implement to be able to connect with that server?

Thanks!
Was This Post Helpful? 0
  • +
  • -

#33 noten  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-May 13

Posted 18 May 2013 - 08:53 PM

Hi!

I know this post is old, but I need some help making the chat public! could ya help me? thanks :D

View Postnoten, on 18 May 2013 - 08:52 PM, said:

Hi!

I know this post is old, but I need some help making the chat public! could ya help me? thanks :D/>


Like, so my friends can play :D
Was This Post Helpful? 0
  • +
  • -

#34 drak_oliver  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-May 13

Posted 26 May 2013 - 10:29 PM

Firstly I want to say thank you very much for this tutorial
I what to ask something,
I try to split this chat aplication into 2 project, 1 project handle server and the other handle client.
Server Project have 3 classes: ChatMessage.java, Server.java, ServerGUI.java
Client Project have 3 classes: ChatMessage.java, Client.java, ClientGUI.java
when I try to run GUI java in both project and, It is successful when sending String Username to server, but when trying to send String message to server in display error:
java.io.EOFException
	at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2577)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1315)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
	at Chat.Client$ListenFromServer.run(Client.java:236)


could anyone tell explain what happen here?
*I use Netbeans IDE
Was This Post Helpful? 0
  • +
  • -

#35 vasser  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-June 13

Posted 24 June 2013 - 12:56 PM

Thank you very much for this tutorial. It is very useful. But I have a few questions.
How to use it in a jsp application? Where should I create client? Can I do this on servlet side?
I want to do something similar to messenger, that we can talk with few persons separately, so how to manage with the messages?
Was This Post Helpful? 0
  • +
  • -

#36 Pataras  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-November 13

Posted 10 November 2013 - 07:44 AM

ok i may be new to this whole thing but i copied the code with a bit of editing, however i have a few questions.
1. Should the message typed by the client appear in the client's GUI instead of the servers's?
2. how does the WHOISIN button work exactly because currently it doesnt seem to function?
3. Messages only appear on the server's GUI, is this correct?
Was This Post Helpful? 0
  • +
  • -

#37 darklord.saha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-June 14

Posted 22 June 2014 - 11:19 PM

I am still not sure about quite a few things. If two friends want to chat from different computers, then do they need to know each others IP address ? If so , how should they use it?
Was This Post Helpful? 0
  • +
  • -

#38 andrfas  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-July 14

Posted 09 July 2014 - 11:48 PM

Thank you for your code.
I have a question: isn't it a good practise to adhere to principles of OOP? In this case, i think, we can divide code on GUI, model (a part of code, that would control connection and receiving/sending messages) and controller, that would connect GUI and model in one piece (he would get a text of message from model and told to GUI to show it).
So the code, in my opinion, would be more supported.
What do you think about it?
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3