Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Threads and Socket client.

Threaded View

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Threads and Socket client.

    Hi guys, I've been programming in java for some time, but I'm not very advanced, I have to make a socket application, client side only.
    This application receives data, searches the database, and returns a value to the server, is working, there is no delay in response, all ok, but the problem is that I can not know when the connection to the server was broken, and the server sends the right question, doesn't answer any kind of command, so I can't make a keepAlive, so I decided to create a timer to restart all clients in 5 minutes, but I noticed that some clients don't stop in time, starting 2 clients on the same server, and with that I get a block on the server, would anyone have any other idea to perform this process?
    For you to understand, my scenario is as follows:
    8 turnstiles running as a server (no option to run as a client)
    1 server, running my application, starting 8 clients, running in threads

    This is the code where I start clients, which get ips from the database turnstiles, using the same port

    Thank you...
    Last edited by semperfy; September 5th, 2019 at 08:06 AM.

Similar Threads

  1. Socket Threads
    By jtseaman85 in forum Threads
    Replies: 2
    Last Post: September 15th, 2011, 12:24 AM
  2. Socket java client
    By atef201080 in forum Java Networking
    Replies: 4
    Last Post: July 13th, 2011, 08:35 AM
  3. Threads in multi client-server application
    By KingOfClubs in forum Threads
    Replies: 1
    Last Post: June 11th, 2011, 12:10 AM
  4. Need help with client socket
    By Robtn in forum Java Theory & Questions
    Replies: 2
    Last Post: May 23rd, 2011, 02:26 PM
  5. client/server socket
    By Java_dude_101 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: January 18th, 2011, 01:16 AM