Improved internal socket emit.
Signed-off-by: Delian Delchev <delian.delchev@gmail.com>