Hello everyone,

fileevent is not behaving as i expect it to.
Can somebody tell me where i a m going wrong.

the following code is executed when i want to connect to a server   
process.

I open an async connection to a server. When the connection is   
established with the server i expect the Connect_Callback proc to be   
called. If the Connect_Callback is not called the Check_For_Failure proc   
will close the async connection and put up a message saying failed to   
connect. My problem is that the Connect_Callback proc is not called when   
the connection is successfully established with the server.
Put_Info is a proc to write some text into a listbox.

global server_sock
global server_host
global server_port
global connected

if { $connected == 1 } {
    Put_Info "Already Connected"
} else {
    Put_Info "Connecting"

    set server_sock [socket -async $server_host $server_port]
    after 5000 [list Check_For_Failure]
    fconfigure $server_sock -buffering line -blocking 0
    fileevent $server_sock writeable [ list Connect_Callback ]
}


Any help will be much appreciated.


Naheed.  
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to