SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
TelnetReceive never returns on stream data

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
TelnetReceive never returns on stream data
Author Message
Sven Opitz



Joined: 02 Dec 2005
Posts: 11

Post TelnetReceive never returns on stream data Reply with quote

Hi,

I have a server that sends a continuous data stream vie TCP.
I want to check if everything is OK, so I use TelnetReceive to save data samples for qulaity control.
But TelnetReceive never returns, as the datafeed never stops.
Is there a possibility to Stop TelnetReceive after a specific number of lines or bytes where received?
Or is there a way to use TelnetReceive to receive Input for maxTime seconds and the stop?

Thanks
Sven

Fri Dec 02, 2005 9:35 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: TelnetReceive never returns on stream data Reply with quote

Try playing with the TIMEOUT parameter. See TelnetConfig topic in the on-line help for details. To disable default error handling enclose TelnetReceive into OnErrorResumeNext and OnErrorStop.

: Hi,

: I have a server that sends a continuous data stream vie TCP.
: I want to check if everything is OK, so I use TelnetReceive to save data
: samples for qulaity control.
: But TelnetReceive never returns, as the datafeed never stops.
: Is there a possibility to Stop TelnetReceive after a specific number of lines
: or bytes where received?
: Or is there a way to use TelnetReceive to receive Input for maxTime seconds
: and the stop?

: Thanks
: Sven

Fri Dec 02, 2005 10:18 am View user's profile Send private message
Sven Opitz



Joined: 02 Dec 2005
Posts: 11

Post Re: TelnetReceive never returns on stream data Reply with quote

: Try playing with the TIMEOUT parameter. See TelnetConfig topic in the on-line
: help for details. To disable default error handling enclose TelnetReceive
: into OnErrorResumeNext and OnErrorStop.

Thanks for the fast answer.
Yet, it does not work that way. The smallest TimeOut seems to be one second.
If the stream doesn"t send data for one whole second, that would constitute a kind of hickup.
The usual amount of data sent on thsi stream is somewhere > 200 Bytes per second.
The longest period without data is a fraction of a second, if everything goes well.

Fri Dec 02, 2005 10:44 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: TelnetReceive never returns on stream data Reply with quote

So why not add some extra logic to handle "hickups?"

: Thanks for the fast answer.
: Yet, it does not work that way. The smallest TimeOut seems to be one second.
: If the stream doesn"t send data for one whole second, that would
: constitute a kind of hickup.
: The usual amount of data sent on thsi stream is somewhere > 200 Bytes per
: second.
: The longest period without data is a fraction of a second, if everything goes
: well.

Fri Dec 02, 2005 1:36 pm View user's profile Send private message
Sven Opitz



Joined: 02 Dec 2005
Posts: 11

Post Re: TelnetReceive never returns on stream data Reply with quote

: So why not add some extra logic to handle "hickups?"

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.

Sat Dec 03, 2005 12:18 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: TelnetReceive never returns on stream data Reply with quote

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.

Sat Dec 03, 2005 5:06 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: TelnetReceive never returns on stream data Reply with quote

Sory, I forgot to mention, that the described solution requires tracing option, it is essential the tracing option is turned on in Tools/Options menu; Log tab. This will cause 24x7 to write telnet.log file, which is used in the Control job to obtain results of the Telnet job.

: 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.

Sat Dec 03, 2005 5:10 pm View user's profile Send private message
Sven Opitz



Joined: 02 Dec 2005
Posts: 11

Post Re: TelnetReceive never returns on stream data Reply with quote

: Sory, I forgot to mention, that the described solution requires tracing
: option, it is essential the tracing option is turned on in Tools/Options
: menu; Log tab. This will cause 24x7 to write telnet.log file, which is
: used in the Control job to obtain results of the Telnet job.

Thank you very much for your information.

Mon Dec 05, 2005 3:55 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.