recieve method in VB6 dev fails, but compiled is o (wodSSH / wodSSH.NET)
Hi support, 2nd thread :)
I have seen some odd behaiviour when using the recieve method within the development environment (VB6) vs compiled program : basically, compiled always works, and dev mode always fails!
to explain :
[code]
Public Function DO_UNIX_COMMAND(UnixCommand As String, Caller As String) As String
On Error GoTo CommsError
Dim Response As String
Dim CommandTime As Date
CommandTime = Now
Response = NETCON.Execute(UnixCommand & vbLf)
Response = Replace(Response, vbCrLf, , , 1)
DO_UNIX_COMMAND = Response
Exit Function
CommsError:
Dim FailureText As String
Dim FailureNumber As Integer
Dim FailureDescription As String
FailureNumber = Err.Number
FailureDescription = Err.Description
FailureText = NETCON.Receive
COMMS_ERROR_HANDLER DO_UNIX_COMMAND ( & Caller & ) , FailureNumber, FailureDescription, FailureText
End Function
[/code]
the above is a trimmed down version of a routine i use for the entirity of my program after logging in to do any commands. the problem is within the error handler commserror . If i :
1/) start my program, and ensure it is constantly doing things with DO_UNIX_COMMAND
2/) login to my unix system, find the shell the program is using, then kill it (kill -9)
.... in 'fully compiled mode' this does not cause an issue, however when in the development mode, VB6 stops on NETCON.Receive (within the error handler), so i cannot test the remainder of the failure code.
i get informed 'not connected' which is true, in which case '.recieve' should either return anything in the buffer before disconnecting or nothing (returns nothing in compiled mode), but it doesnt do either in development mode!
is there anything i can do to 'get round' this?
birchsr
Re: recieve method in VB6 dev fails, but compiled
Hi,
Are you maybe using break points?
That could cause an issue because during break point is called ssh connection flows in background and data from server will not be capture by wodSSH in Receive Method.
Regards,
Drazen
Re: recieve method in VB6 dev fails, but compiled
Are you maybe using break points?
nope, i learned that issue (pausing) whilst developing my program :)
no break points, just letting it run. i was tempted to put a on error resume next in there on the line previous to clear in-house debugging, but i would rather understand why it's not doing what it does when compiled, before accepting it. it's not a big issue, but something which is bugging me :)
birchsr
Re: recieve method in VB6 dev fails, but compiled
Hi,
Feel free to zip and send us sample that will duplicate your issue to techsupport@weonlydo.com
If we can duplicate some issue we will try to find solution for it.
Drazen