Adds socketstream boilerplate.