To get the ip of the devices connected to a specific port.

H,

I want to know the ip of the devices connected to a specific port.
Suppose 2 s/m's are connected to port 3092. I want to get the ip of those system's .
how do i get it?

# port=3092
# netstat -an | awk -v p=$port '{n=split($2,a,".");if (p==a[n]) print }'

use nawk on Solaris