i have added a chat option. i haven't used sockets or ports because i have no knowledge of it. i have used a timer say 1 second and after every second the database is checked for any changes and if there is any, the user is alerted at that moment itself. The database is shared over the network. This thing works and my JPanel is updated and it works smoothly just like a chat. i would like to ask that, is polling the database after every second efficient ? is it a nice idea? Thanks in advance guys! do suggest:-)
Asked
Active
Viewed 233 times
0
-
1I would take a read through [Custom Networking](http://docs.oracle.com/javase/tutorial/networking/TOC.html) and [All About Sockets](http://docs.oracle.com/javase/tutorial/networking/sockets/index.html) in particular – MadProgrammer Oct 25 '12 at 09:20
-
1Here's a basic [example](http://stackoverflow.com/a/3245805/230513). – trashgod Oct 25 '12 at 10:26
1 Answers
2
If you have no concept of socket programming. I suggest you forget about the swings at this moment and take a look at this first.

Drogba
- 4,186
- 4
- 23
- 31
-
-
Yes, it will become **VERY** inefficient as soon as you go multi-user. For one user it makes no difference – Germann Arlington Oct 25 '12 at 08:26
-