jsx as a windows service
I wrote socket listener class in javascript/photoshopscript.
I basically need this to be running at all times.
Here is a dumbed down code example that basically returns what is sent to it.
Is there anyway to get this to run as a windows service?
Currently I start it up from extendscript
#target photoshop
function Server( _port ){
this.port = _port;
this.tcp = new Socket( )
this.connection;
this.start = function( callBackFunc ){
if( this.tcp.listen( this.port ) ){
for(;;){
this.connection = this.tcp.poll()
if( this.connection != null ){
var tmp = this.connection.readln()
callBackFunc( tmp )
}
}
}
},
this.response = function( val ){
this.connection.writeln( val )
}
}
function callBackFunction( data ){
server.response( data )
}
var server = new Server( 12345 );
server.start( callBackFunction )