• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Program Socket Communication takes too long time receiving a message from client

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I have a program communication via socket. The program waits for multiple clients, receive the message from each client and then responds and wait for another client. bellow the code:



The problem is that: between a client and another, the program takes around two minutes to process. Even the client send a message immediately.

The command:



stay too long time to processing.

Only after this time (2 minutes or more) the client gets the message.

What I am doing wrong?

Thanks

Fernando
 
Marshal
Posts: 4501
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To begin with - your code as posted doesn't compile.

I cleaned-up the code and ran it with three clients connected simultaneously and didn't experience the behaviour that you described.

My environment was:
   - Windows 7 64 bit
   - Java 1.8 runtime
   - netcat 64 bit client (locally connected - didn't try on different platform)

Try and post the actual code that you are running along with some details of your test environment.
 
reply
    Bookmark Topic Watch Topic
  • New Topic