Java judgment has enabled process instance method

Source: Internet
Author: User
Tags instance method

The steps of the Loop network server programming are:

[url]screen.width*0.7) {this.resized=true; this.width=screen.width*0.7 this.alt= ' Click here to open new windownctrl+ Mouse wheel to zoom in/out ';} ' Onmousewheel= "return imgzoom (this);" > [/URL]

This server model is a typical cyclic service, if not with multiple process/threading technology, this service throughput is limited, we can see that if the previous connection service data is not sent and received after the connection cannot be handled. So there is generally a lot of process technology, a new connection to enable a new process to deal with, and listening to the socket to continue listening.

Java code

public  Boolean getprocess () {
Boolean flag=false;
try{
process   p   =   runtime.getruntime (). EXEC ("cmd  /C &N Bsp Tasklist ");
bytearrayoutputstream   baos   =   new   bytearrayoutputstream ();
inputstream   os   =   p.getinputstream ();
byte   b[]   =   new   byte[256];
while (Os.read (b) > 0)
Baos.write (b);
string   s   =   baos.tostring ();
//System.out.println (s);
if (S.indexof ("Besttone.exe") >=0) {
System.out.println ("yes");
Flag=true;
}
else{
System.out.println ("no");
Flag=false;
}
}catch (java.io.ioexception   IoE) {
}
return flag;
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.