PageRenderTime 41ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/bsh/commands/server.bsh

#
Unknown | 15 lines | 13 code | 2 blank | 0 comment | 0 complexity | e64e8d3bf0c5a4da154a581db64664f4 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /**
  2. Create a remote BeanShell listener service attached to
  3. the current interpreter, listening on the specified port.
  4. */
  5. import bsh.util.Httpd;
  6. import bsh.util.Sessiond;
  7. bsh.help.server = "usage: server(int port)";
  8. void server(int port ) {
  9. new Thread( new Httpd( port ) ).start();
  10. print("Httpd started on port: "+port);
  11. new Thread( new Sessiond( global.namespace, port+1 ) ).start();
  12. print("Sessiond started on port: "+ (port+1));
  13. }