This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

onMessage method of websocket client endpoint stopping after message received  RSS feed

Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.

I have a websocket java client connecting to a server to read back the messages from that server. The onMessage method does appear to be obtaining the messages from the server but I noticed an issue when I added further code within the same method. In my case I wanted to log the messages to a database but noticed the database code was not being executed. I removed the database code and put in some println debug and found out that they were not always being executed or that some were but others were not.I also added a for loop which too should complete but stops before the end at differing points, I have the onError and onClose methods implemented and they are not being fired by any error or socket closure. I have included the client code below. Has anyone else encountered this? I'm running jdk 7 and I'm really puzzled by this.

I am Arthur, King of the Britons. And this is a tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!