socket tests and functionality expanded