Telnet Crashes (I'm an employee of NetBrain) (General questions)
If I set the telnet blocking option to FALSE , and when I telnet simultaneously to 12 different IPs, everything is fine; but when I telnet more than 16 different IPs, the application will crash.
The following is the crash data:
wodTelnetDLX.dll!6b00fa9e()
wodTelnetDLX.dll!6b006cb6()
wodTelnetDLX.dll!6b008c00()
user32.dll!7e418734()
user32.dll!7e418816()
user32.dll!7e4189cd()
user32.dll!7e4196c7()
aaa.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00141f01, int nCmdShow=1) Line 265 + 0xf C++
aaa.exe!WinMainCRTStartup() Line 390 + 0x39 C
kernel32.dll!7c816fd7()
Re: Telnet Crashes (I'm an employee of NetBrain
Hi,
We will need more info about your crash to find out what is wrong here.
You mention that this happened when Blocking is set to False. So when Blocking is True all is working?
You are running same code in loop? If this is true can you try reloading wodSSH reference for each loop.
At the end of wodSSH code add Set ssh1 = Nothing so when each new loop is made new reference will be started. That could resolve your problem.
Let us know how it goes.
Regards,
Drazen
Re: Telnet Crashes (I'm an employee of NetBrain
i'm use vc , there is some code snippet.
class IwodTelnetDLXCom : public COleDispatchDriver
IwodTelnetDLXCom::IwodTelnetDLXCom()
{
// OLE init
OleInitialize(NULL);
// create wodTelnetDLXCom
if (!CreateDispatch( WeOnlyDo.wodTelnetDLXCom.1 ,NULL))
{
AfxMessageBox( Could not create wodTelnetDLX object ,MB_OK,0);
return;
}
// attach events
m_pTelnetDLXEvents = new CEventSink;
LPUNKNOWN pUnknown= m_pTelnetDLXEvents->GetIDispatch(FALSE);
AfxConnectionAdvise(m_lpDispatch,DIID__IwodTelnetDLXComEvents,pUnknown,FALSE,&m_dCookie);
m_pTelnetDLXEvents->m_pCtrl= this;
}
IwodTelnetDLXCom::~IwodTelnetDLXCom()
{
LPUNKNOWN pUnknown = m_pTelnetDLXEvents->GetIDispatch(FALSE);
AfxConnectionUnadvise( m_lpDispatch,DIID__IwodTelnetDLXComEvents,pUnknown,FALSE,m_dCookie);
ReleaseDispatch();
if(m_pTelnetDLXEvents)
{
m_pTelnetDLXEvents->m_pCtrl = NULL;
delete m_pTelnetDLXEvents;
m_pTelnetDLXEvents = NULL;
}
OleUninitialize();
}
IwodTelnetDLXCom::connect( string ipaddress )
{
SetHostname( ipaddress );
SetPort( nRemotePort );
SetBlocking( FALSE );
SetTimeout( 0 );
SetProtocol( 1 );
try
{
VARIANT var;
var.vt = VT_ERROR;
Connect( var , var , var );
}
catch (COleDispatchException *e)
{
//do something
}
}
i want to get many router's config file using command show run of telnet.so i create n instance of IwodTelnetDLXCom;
if n less and equal 12 , evertyting is fine; if n==13, sometimes crash.if n > 13 , always crash.
IwodTelnetDLXCom aa[n];
for( int i = 0 ; i < n; i++ )
{
aa.connect( ipaddress );
}
when connected sucessfully , application trigger received event.
the folowing is my rece function 's code
VARIANT var;
var.vt = VT_ERROR;
VARIANT var2;
var2.vt = VT_I2;
var2.iVal = VT_BSTR;
var2 = Receive(var, var2);
char* lpszText = _com_util::ConvertBSTRToString( var2.bstrVal );
SaveFile( filename , lpszText )
i want to know what's wrong of my code , i hope you can help me , thanks
Re: Telnet Crashes (I'm an employee of NetB
Hi,
It is hard to see what could be wrong just by looking at the code snippet. Could you e-mail us the whole application or just a small sample that duplicates the problem? That would help a lot.
You can e-mail it to techsupport@weonlydo.com
Regards,
Grof
Re: Telnet Crashes (I'm an employee of NetBrain
I have just send the whole application.
in my computer , ip address from 1.1.1.1 to 1.1.1.22 is cisco router.
thanks
Re: Telnet Crashes (I'm an employee of NetBrain
I find a strange thing . from 1.1.1.1 to 1.1.1.22 , there are 4 ip address which is not reachable from my computer .when I call SetTimeout( 5 ), everyting is fine.but if I call SetTimeout( 0 ) , the crash will be appear.