awk transpose column to row and sort

I am trying to awk the output from below output for each port: i need separate line with comma

source file

Output required

awk '{if($0 ~ /^port: [0-9]*$/ && NR > 1) print "\n" $0; else print}' file | awk '{out = $1; for(i = 2; i<= NF; i++) {out = (out "," $i)}; print out}' FS='\n' RS=
paste -d, - - - - - - - - - - < file

thanks for the support i can able to resolve this by using this.