debuggers: import openocd-0.7.0
Initial check-in of openocd-0.7.0 as it can be downloaded from http://sourceforge.net/projects/openocd/files/openocd/0.7.0/ Any modifications will follow. Change-Id: I6949beaefd589e046395ea0cb80f4e1ab1654d55
This commit is contained in:
26
debuggers/openocd/jimtcl/examples/udp6.server
Normal file
26
debuggers/openocd/jimtcl/examples/udp6.server
Normal file
@ -0,0 +1,26 @@
|
||||
# Example of a udp server listening on ipv6 which sends a response
|
||||
# Note that on many hosts, this will also respond to ipv4 requests too
|
||||
|
||||
# Listen on port 20000.
|
||||
set s [socket -ipv6 dgram.server {[::]:20000}]
|
||||
|
||||
# For each request...
|
||||
$s readable {
|
||||
# Get the request (max 80 chars) - need the source address
|
||||
set buf [$s recvfrom 80 addr]
|
||||
|
||||
puts -nonewline "read '$buf' from $addr"
|
||||
|
||||
try {
|
||||
set result "$buf = [expr $buf]"
|
||||
} on error {msg} {
|
||||
set result "Error: $buf => $msg"
|
||||
}
|
||||
|
||||
puts ", sending '$result'"
|
||||
|
||||
# Send the result back to where it came from
|
||||
$s sendto $result $addr
|
||||
}
|
||||
|
||||
vwait done
|
||||
Reference in New Issue
Block a user