Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7902231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:26:29+00:00 2026-06-03T09:26:29+00:00

I have a while(true) loop running for a Java server (to listen) that I

  • 0

I have a while(true) loop running for a Java server (to listen) that I am trying to learn. I utilize jGrasp for compiling and running.

After a connection is made and disconnected the server is of course still “listening”

What I would like to know is how to manualy send a break (like a ctrl-c) in jGrasp ?

I noticed that simply hitting END will stop the program but of course it will never reach the socket.close() method and this of course causes other issues.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:26:31+00:00Added an answer on June 3, 2026 at 9:26 am

    One way of doing this would be to create a variable and set it to true and have your loop be while(variable)… Then using the debugger (not sure if you can do this in jGrasp) you can change the value of the variable (to false) mid execution if you setup a breakpoint inside the loop. After changing it on the next loop evaluation that variable will be false and it will exit the loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have in my Java application a thread that run a while(True) loop with
So I have a Linux program that runs in a while(true) loop, which waits
I'm running this loop on the server side: while (true) { $changed = $this->sockets;
I have a function that I'm using while(true) to repeatedly scan memory addresses of
I have a server-sent events handler in ASP.NET Response.ContentType = text/event-stream; while (true) {
I have a while loop that loops through 3 results and echo's these out
EDIT: I'm now sure that the problem is related to the while (true) loop
I am trying to have my program break out of a while loop when
Im trying to make a basic email system in Java. I have a server
In the code below, I have a while(true) loop. Consider a situation where there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.