php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64536 socket_read: the connection is hung
Submitted: 2013-03-28 07:47 UTC Modified: 2013-03-28 09:45 UTC
From: perepechaev at inbox dot ru Assigned:
Status: Closed Package: ncurses (PECL)
PHP Version: 5.4.13 OS: FreeBSD 8.2-RELEASE i386
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: perepechaev at inbox dot ru
New email:
PHP Version: OS:

 

 [2013-03-28 07:47 UTC] perepechaev at inbox dot ru
Description:
------------
I run a connection and get a break when trying to resize a window


Test script:
---------------
<?php

$address = 'localhost';
$port = 9002;

$socket = @socket_create( AF_INET, SOCK_STREAM, SOL_TCP);
$connected = 0;
if ( $socket ){
    $conected = socket_connect( $socket, $address, $port);
}

ncurses_init();
ncurses_refresh();

while (true){
    $server = @socket_read( $socket, 1024 * 8);
        if ( $server ){
            ncurses_addstr("SERVER\n");
        }
        else {
            // ERROR: Interrupted system call
            ncurses_addstr("ERROR: " . socket_strerror(socket_last_error($socket)) . "\n");
    }
    ncurses_refresh();
}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-28 09:42 UTC] perepechaev at inbox dot ru
-Status: Open +Status: Closed
 [2013-03-28 09:42 UTC] perepechaev at inbox dot ru
Accept my sorry 
I think I need to handle the system interrupt

pcntl_signal(28, SIG_IGN, true);
 [2013-03-28 09:45 UTC] perepechaev at inbox dot ru
Transferred to ncurses package
 [2013-03-28 09:45 UTC] perepechaev at inbox dot ru
-Package: ncurses related +Package: ncurses
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 14:01:30 2024 UTC