Tcl thread and expect

View: New views
2 Messages — Rating Filter:   Alert me  

Tcl thread and expect

by Indrojit Paul :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

Basically I am trying to spawn a telnet session from a separate thread.

Following Tcl script is executed on a Windows machine.

 

package require Thread

set threadId [thread::create]

thread::send $threadId {

    package require Expect

    spawn telnet 10.101.210.200

    expect  {

    "login:"            { send -- "test\n" }

     }

    expect  {

    "Password:"         { send -- "test123\n" }

    }

    send -- "exit\n"

    expect "logout"

}

thread::release $threadId

 

I get the error “FlushChannel: damaged channel list” at the end of execution.

The telnet session goes well but at the end of execution I get the above error.

Following packages are used

Tcl8.5.3

Expect5.43

Thread2.6.5

Is there any solution for this?

 

Regards,

Indrojit Paul

 

DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tcl-Threads mailing list
Tcl-Threads@...
https://lists.sourceforge.net/lists/listinfo/tcl-threads

Re: Tcl thread and expect

by Devin Eyre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

http://wiki.tcl.tk/11581

 


From: tcl-threads-bounces@... [mailto:tcl-threads-bounces@...] On Behalf Of Indrojit Paul
Sent: Thursday, July 24, 2008 8:11 AM
To: tcl-threads@...
Subject: [Tcl-Threads] Tcl thread and expect

 

Hi,

Basically I am trying to spawn a telnet session from a separate thread.

Following Tcl script is executed on a Windows machine.

 

package require Thread

set threadId [thread::create]

thread::send $threadId {

    package require Expect

    spawn telnet 10.101.210.200

    expect  {

    "login:"            { send -- "test\n" }

     }

    expect  {

    "Password:"         { send -- "test123\n" }

    }

    send -- "exit\n"

    expect "logout"

}

thread::release $threadId

 

I get the error “FlushChannel: damaged channel list” at the end of execution.

The telnet session goes well but at the end of execution I get the above error.

Following packages are used

Tcl8.5.3

Expect5.43

Thread2.6.5

Is there any solution for this?

 

Regards,

Indrojit Paul

 

DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tcl-Threads mailing list
Tcl-Threads@...
https://lists.sourceforge.net/lists/listinfo/tcl-threads
LightInTheBox - Buy quality products at wholesale price!