Jump to content

StdoutRead -when the limit of characters is insufficient-


Recommended Posts

Local $foo = Run(@ComSpec & " /c " & "netstat -o -f -n -p TCP", "", @SW_HIDE , $STDOUT_CHILD)
Local $line = StdoutRead($foo)
Local $avArray = StringSplit($line, @LF)
Local $avstring =_ArrayToString($avArray,@LF)

I use netstat to individualize if a process (PID) is currently at least a connection active internet, all works well until the connections they become a lot, then I have deduced that the cause is the maximum limit of characters of StdoutRead, but the command netstat doesn't allow me to subsequently filter, do you know a solution?

if I could for example eliminate all the numbers I could use the recognition of process rather than of the PID.. <_<

Link to comment
Share on other sites

Have you tried using a loop to fully read the complete stdout?

example:

Local $line, $foo = Run(@ComSpec & " /c netstat -o -f -n -p TCP", "", @SW_HIDE , $STDOUT_CHILD)
Do
    $line &= StdoutRead($foo)
Until @error
Local $avArray = StringSplit($line, @LF)
Local $avstring =_ArrayToString($avArray,@LF)

You can do up to 64KB in a single read, but you can continue reading the buffer until StdoutRead() produces @error.

<_<

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...