Constructor from native socket