socket -server acceptClient 53210 set State(count) 0 ################################################################ # proc acceptClient {channel ip port}-- # Accept a connection from a remote client # Arguments # channel The channel assigned to this connection # ip The IP address of the client # port The port assigned to this connection # Results # A new channel is opened and then closed. # global variable State is modified. # proc acceptClient {channel ip port} { global State incr State(count) puts $channel "Welcome visitor number $State(count)" close $channel }