Help for this page

Select Code to Download


  1. or download this
    # build up a buffer
    sysread(CLIENT, $read_buffer, 2048);
    ...
    while ( sysread(CLIENT, $read_buffer, 512) ) {
        $buffer .= $read_buffer;
        syswrite( AUDIO_OUT, $buffer, 512);
    
  2. or download this
    my $child_pid;
    if ( not defined($child_pid = fork()) ) {
    ...
        exit;
    }
    waitpid($child_pid, 0);