Jump to content

kali707

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by kali707

  1. no answers from anybody so i assume this is not possible. will close this topic soon. thanks guys.
  2. hi guys, Just created my id on this forum. posting for the first time. The socket server does not send an EOF. Instead it sends a code to signal the end of the data. In the following code socket is opened without any problems. fputs works fine. But when the while loop is executed $info['timed_out'] is FALSE for each iteration as long as $info['unread_bytes'] != 0. In the last iteration $info['timed_out'] becomes TRUE (dont' know why). So, in the last iteration data does not get appeneded to $resp_all. What I am trying to do is to make sure that I have read all the data through the socket until that end-of-data signal/code is received (there is no EOF sent by the server). So I am trying to make sure that the data is not half-read or incomplete. If there is a timeout reading the data it should try again (at least 3 times). If you have any other suggestions/ideas to accomplish this please let me know. $fp = fsockopen($host, $port, $errno, $errdesc, 5); fputs($fp, $msg); $tryCnt = 1; stream_set_timeout($fp, 35); while ($tryCnt <= 3) { $rsp = fgets($fp, 1024); $info = stream_get_meta_data($fp); if ($info['timed_out']) { $tryCnt += 1; continue; } $rsp_all .= $rsp; # check for end of data signal and if there is, then break out }
  3. folks, i know i may be asking a question that has been answered before but i am asking this here again because i could not find any simple and straightforward answers. i want to debug my php scripts. no web server is involved. all the scripts are used for parsing and preparing data files...something like we do with unix shell scripting. the scripts reside on a linux box and each script may call functions in other included scripts. i can connect to the linux box using my notebook. on my notebook i have Eclipse and PhpEd. i want to debug those php scripts on the linux box using my notebook's Eclipse or PhpEd. (no webserver or html involved and php cli is already setup and running scripts on the linux box). If this (using PhpEd and Eclipse on the notebook to remotely debug) is not possible can you please suggest me how do i debug those scripts while i am on the linux server (using command line etc.). please help me how to set up. regards, kali
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.