홈>
이것은 apn을 보내는 데 사용하는 코드의 일부입니다.
Options = case Password of
undefined ->
[{certfile, Cert}, {keyfile, Keyfile}, {mode, binary}];
_ ->
[{certfile, Cert}, {keyfile, Keyfile}, {password, Password}, {mode, binary}]
end,
case ssl:connect(Address, Port, Options, ?Timeout) of
{ok, Socket} ->
PayloadBin = list_to_binary(Payload),
PayloadLength = size(PayloadBin),
TokenNum = erlang:binary_to_integer(Token, 16),
TokenBin = <<TokenNum:32/integer-unit:8>>,
Packet = <<
0:8,
32:16/big,
TokenBin/binary,
PayloadLength:16/big,
PayloadBin/binary
>>,
ssl:send(Socket, Packet),
ssl:close(Socket),
?DEBUG("mod_apns: Successfully sent payload to the APNS server", []),
ok;
{error, Reason} ->
?ERROR_MSG("mod_apns: Unable to connect:~p to the APNS server ~p: ~p", [Options, Address, Reason]),
Reason
end
그러나이 오류가 발생합니다 :
Unable to connect:[{certfile,<<"/etc/certificates/myCer.pem">>},{keyfile,<<"/etc/certificates/myKey.pem">>},{mode,binary}] to the APNS server <<"gateway.push.apple.com">>: {options,{socket_options,[{mode,binary}]}}
이 ejabberd 모듈이며 동일한 코드는 ejabberd 17.04에서 작동하지만 17.06에서는 작동하지 않습니다.
인증서와 키가 유효하며 이전 버전의 ejabberd와 동일한 얼랭 모듈을 사용하여 apn을 얻을 수 있습니다.
나는 erlang을 처음 사용하는데 오류 메시지
({options,{socket_options,[{mode,binary}]}})
를 이해하지 못한다
도움이 필요합니다.
- 답변 # 1
트렌드
- OpenCv의 폴더에서 여러 이미지 읽기 (python)
- 파이썬 셀레늄 모든 "href"속성 가져 오기
- html - 자바 스크립트 - 클릭 후 변경 버튼 텍스트 변경
- javascript - 현재 URL에서 특정 div 만 새로 고침/새로 고침
- JSP에 대한 클래스를 컴파일 할 수 없습니다
- JavaScript 변수를 HTML div에 '출력'하는 방법
- git commit - 자식 - 로컬 커밋 된 파일에 대한 변경을 취소하는 방법
- jquery - JavaScript로 현재 세션 값을 얻으시겠습니까?
- javascript - swiperjs에서 정지, 재생 버튼 추가
- python - 화면에서 찾은 요소를 찾을 수없는 경우 셀레늄
문제는 내가리스트 대신 바이너리를 보내는 것이 었습니다 :