This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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 ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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.
thanks.


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!