README.md
1 # dt_fd_forward
2
3 dt_fd_forward is a jdwpTransport library. It implements the [Java Debug Wire
4 Protocol Transport Interface
5 (jdwpTransport)](https://docs.oracle.com/javase/7/docs/technotes/guides/jpda/jdwpTransport.html).
6 It allows one to handle and proxy JDWP traffic by supplying the implementation
7 for Attach. This transport requires an address. The address is a single integer
8 value that is the file-descriptor of an open AF\_UNIX socket.
9
10 When this transport begins listening or attaching it will send the
11 null-terminated string "dt_fd_forward:START-LISTEN\0" over the given socket.
12
13 When this transport stops listening for connections it will send the
14 null-terminated string "dt_fd_forward:END-LISTEN\0" over the socket.
15
16 When this transport has successfully received fds from the proxy it sends the
17 message "dt_fd_forward:ATTACHED\0" over the socket.
18
19 When this transport has closed its copies of the fds it will send the proxy the
20 message "dt_fd_forward:CLOSING\0" over the socket.
21
22 When this transport accepts or attaches to a connection it will read from the
23 socket a 1 byte message and 3 file-descriptors. The file descriptors are, in
24 order, an fd that will be read from to get incoming JDWP packets (read\_fd\_),
25 an fd that outgoing JDWP packets will be written to (write\_fd\_), and an
26 _eventfd_ (write\_lock\_fd\_). The eventfd should not have any flags set. Prior
27 to writing any data to write\_fd\_ the transport will _read_ from the
28 write\_lock\_fd\_ and after finishing the write it will _write_ to it. This
29 allows one to safely multiplex data on the write\_fd\_.
30
31 This transport implements no optional capabilities, though this may change in
32 the future.
33