A problem in Parse data from socket.

From: Payton Chou (payton.chou_at_gmail.com)
Date: 10/27/04


Date: 27 Oct 2004 02:50:28 -0700

Dear all.
I got one problem. That I get the data from the socket.
But I don't have any idear to parse this.
Are there anyone can give me a hand ?

The following is my function.

proc GetData { channel who} {
  if { [ eof $channel ] } {
    catch { close $channel }
    return
  }
  
  gets $channel buf
  
  puts stdout "$who gets $buf"
}

I need to parse the buf to hexdecimal. ex. 0x0001 0x0002 ...

Thanks