add some basic snippet for socket