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 6119145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:31:05+00:00 2026-05-23T15:31:05+00:00

My program seems stopped after the blank line detected until I press the stop

  • 0

My program seems stopped after the blank line detected until I press the stop button in broswer.

Before the stop button is pressed:

enter image description here

After the stop button is pressed:

enter image description here

Here is part of the code:

while (accept CONNECTION, SERVER ) {
  select CONNECTION; $| = 1; select STDOUT;
  print "\n>> Client connected at ", scalar(localtime), "\n";

  my $isGet = 1;
  my $isPostAndBlankLineDetected = 0;
  while (<CONNECTION>) {
    s/\r?\n//;
    my $msg = $_;
    rubyP "$msg";

    if ($msg  =~ /GET/) {
      processGet($msg);
      last;
    }

    if ($msg  =~ /POST/) {
      setReqMethodAndReturnUri($msg);
      $isGet = 0;
    }

    if ($isPostAndBlankLineDetected) {
      pp "isPostAndBlankLineDetected is true";
      last;
    }

    if( ! $isGet) { #isPost
      if ($msg  =~ /Content-Length/) {
        setContentLength($msg);
      }

      if ($msg eq "") {
        $isPostAndBlankLineDetected = 1;
        pp "done setting isPostAndBlankLineDetected";
      }
    }
  }

  close CONNECTION;
  print ">> Client disconnected\n";
}

I have a last statement in if ($isPostAndBlankLineDetected).

Here is the socket part:

use Socket;

require "helper.pl";

sub rubyP { #print raw string
  my $arg = $_;

  use Data::Dumper;
  $Data::Dumper::Useqq = 1;
  print Dumper $arg;

}


sub pp {
  print "DEBUG: '$_[0]'\n";
}



my $protocol = getprotobyname 'tcp';

my $port = 15032;
my $server_addr = sockaddr_in($port, INADDR_ANY);

socket SERVER, AF_INET, SOCK_STREAM, $protocol
  or die "Unable to create socket: $!";

bind SERVER, $server_addr
  or die "Unable to bind: $!";

listen SERVER, SOMAXCONN;
  • 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-05-23T15:31:05+00:00Added an answer on May 23, 2026 at 3:31 pm

    You falsely assume there is a “line” that follows. Even if something follows, it might not be ended by have a newline.

    read Content-Length bytes.

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

Sidebar

Related Questions

I have an application that seems to throw exceptions only after the program has
My Java program seems to hang after I run it using Windows shell. I
I'm working on a socket program and everything seems fine when compiling. First I
I have a program in C using Solaris with VERY ancient compatibility it seems.
I need to understand the working of this particular program, It seems to be
How ASP.NET compiles its assemblies generally confuses me. It seems that I cannot program
Folks, This seems like a basic program and I cannot understand what is going
this program seems be fine but I still getting an erro, some suggestion? Program:
The overall program is too complex to display here. Basically, just pay attention to
After upgrading Jasper to the last version, it stopped finding one font: Symbol. The

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.