/************************************************************************* * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca) * * Plugin for PHP unit Testing. * www.phpeclipse.de * *************************************************************************/ package net.sourceforge.phpeclipse.phpunit.reporthandling; import java.net.ServerSocket; import java.net.Socket; import net.sourceforge.phpeclipse.phpunit.PHPUnitView; public class ConnectionListener extends Thread { private ServerSocket sSocket = null; private Socket serviceSocket = null; private PHPUnitView view; public void start(PHPUnitView view) { this.view = view; super.start(); } public void run() { try { //reportArea.append("listening at port 12345"); sSocket = new ServerSocket(12345); // accept connection from test reporter. serviceSocket = sSocket.accept(); (new ReportListener(serviceSocket, this.view)).start(); sSocket.close(); } catch (Exception e) { e.printStackTrace(); } } // end of run() public static void main(String[] args) { (new ConnectionListener()).start(new PHPUnitView()); } }