Check if socket was defined to create a new one.