I think the following "dirty" solution can be used in this case. Without having access to your server I cannot realy try it. The idea is to have 2 jobs: one job will do the "Telnet" thing the other will constol the entire process and teminate the Telnet job after some time 1. In the Telnet job you put what you have now. Set that job's schedule to [no schedule]. 2. You schedule the Control job as needed in the job JAL script you can code something like below Dim( Timeout, number, 50 ) Dim( ProcessID, number ) OnErrorResumeNext( ) FileDelete( "@V"24x7_home"\telnet.log" ) RunAndWait( "24x7.exe /JOB [telnet job id here]", "", Timeout, ProcessID ) OnErrorResumeNext( ) Dim( LogText, string ) Dim( Temp, string ) FileReadAll( "@V"24x7_home"\telnet.log", LogText ) GetToken( "RECEIVE>", LogText, Temp ) // LogText now contains data received from the Quote server // you can continue from here as needed // Of course you can adjust the Timeout and other parameters as needed. : OK, here is what I planned to do: Dim( sQuoteData, string ) : Dim( iQuoteDataLenght, number ) : TelnetConfig( "TIMEOUT", 50 ) : TelnetConfig( "AUTHENTICATE", "FALSE" ) : TelnetConnect( "QuoteServer", "", "" ) : TelnetReceive( sQuoteData ) : Length( SQuoteData, iQuoteDataLength ) : ... : The problem is, TelnetReceive never returns... : The Timeout is ignored, the only way to stop the job is to kill it : via Taskmanager. : If I set Timeout to 1, the problem is the same. : So my question is, can I do a TelnetReceive, that returns with data? : P.S.: It would have surprised me, if TimeOut would have worked, as Timeout is : described as : the maximum time to wait for data. The problem is not, that it may take a : long time, until : data is received, the problem is, that the data almost immediately arrives : and never stops after that.
|