Changed Web Socket implementation to not send an empty frame at the end

#2777
Made changes as per code review feedback

#2777