[xdebug-general] Re: Beginner issues with remote debug

From: Anil T Samuel <Anil.Samuel[@]oracle.com>
Date: Fri, 11 Jan 2008 11:13:17 +1100

Thanks for that; Now I am using Xdebug Simple DBGp client (0.10.0)

I am using the following java code to act as a debug server to connect
to debugclient; I don't see any activity at debugclient on reception
of <init>; i expected some error reg the fileuri.

//connect to debugclient:9000
                final Socket s = new Socket(args[0], Integer.parseInt(args[1]));
//on connection debugclient displays Connect in its std output.
                final int size = s.getReceiveBufferSize();

//retrieve the client response on a thread and write that to console
                new Thread() {
                        public void run() {
                                byte[] buffer = new byte[size];
                                while (true) {
                                        int r = 0;
                                        try {
                                                r = s.getInputStream().read(buffer);
                                        } catch (Exception e) {
                                                e.printStackTrace();
                                        }
                                        if (r < 0)
                                                break;
                                        String line = new String(buffer);
                                        System.out.print(line);
                                }
                        }
                }.start();

//write the <init> packet to the debugclient
                s.getOutputStream().write(init.getBytes());
                s.getOutputStream().flush();

String init = "<init xmlns=\"urn:debugger_protocol_v1\""
                                        + " xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\""
                                        + " fileuri=\"file:///home/httpd/www.xdebug.org/html/docs/
index.php\""
                                        + " language=\"PHP\""
                                        + " protocol_version=\"1.0\""
                                        + " appid=\"13202\""
                                        + " idekey=\"derick\">"
                                        + "<engine version=\"2.0.0RC4-dev\"><![CDATA[Xdebug]]></engine>"
                                        + "<author><![CDATA[Derick Rethans]]></author>"
                                        + "<url><![CDATA[http://xdebug.org]]></url>"
                                        + "<copyright><![CDATA[Copyright (c) 2002-2007 by Derick
Rethans]]></copyright>"
                                        + "</init>"

Any thoughts ?

Regards
Anthos
Received on Sat Jan 12 2008 - 06:09:59 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST