Hi everyone, i have some favor could some one help me ?
i have
server.tcl
proc Echo_Server {port} {
global x
set s [socket -server EchoAccept $port]
vwait connected
}
proc EchoAccept {sock addr port} {
global echo
puts "Accept $sock from $addr port $port"
set echo(addr,$sock) [list $addr $port]
# Ensure that each "puts" by the server
# results in a network transmission
fconfigure $sock -buffering line
# Set up a callback for when the client sends data
fileevent $sock readable [list Echo $sock]
}
proc Echo {sock} {
global echo
if {[eof $sock] || [catch {gets $sock line}]} {
close $sock
puts "Close $echo(addr,$sock)"
unset echo(addr,$sock)
} else {
puts $sock $line
}
}
and i need to create some loop which shows me acctualy connected clients and show me all connections from beginning.
Can someone show me how to do this pls.
i have
server.tcl
proc Echo_Server {port} {
global x
set s [socket -server EchoAccept $port]
vwait connected
}
proc EchoAccept {sock addr port} {
global echo
puts "Accept $sock from $addr port $port"
set echo(addr,$sock) [list $addr $port]
# Ensure that each "puts" by the server
# results in a network transmission
fconfigure $sock -buffering line
# Set up a callback for when the client sends data
fileevent $sock readable [list Echo $sock]
}
proc Echo {sock} {
global echo
if {[eof $sock] || [catch {gets $sock line}]} {
close $sock
puts "Close $echo(addr,$sock)"
unset echo(addr,$sock)
} else {
puts $sock $line
}
}
and i need to create some loop which shows me acctualy connected clients and show me all connections from beginning.
Can someone show me how to do this pls.