지워지지 않는 마법처럼 신비한..

해결의 힌트 ::
Client.Error.DeliveryInDoubt
Channel disconnected before an acknowledgement was received

are the most annoying and trickiest error to debug when you are using Flash Remoting through AMFPHP.

But this error is actually pretty simple. It simply means there is a syntax error in your PHP code or the SQL statement within your PHP code.

To solve this problem make sure that:
  • Your Adobe Flex function parameters and PHP function parameters are of the same number.
  • The parameters of your Adobe Flex function are in the same order with its PHP function counterpart.
  • All the Adobe Flex function parameters are of the same data type with their PHP function parameters counterpart.
  • You assign a default value to the optional parameters in the PHP function.
  • You pass a value to the parameters that are not optional.
  • Finally, your SQL statements should be syntactically correct.
--------------------------------------------------------

결론은 PHP 코드쪽의 오류라는건데, 정답은 PHP 코드의 오류 또는 리턴값외의 PHP 출력값이 있을경우 이런 오류가 발생한다.
즉 디버깅등을 위해 echo나 var_dump()등으로 해당 PHP코드가 정상적으로 값을 리턴하는지 확인할 경우 echo등으로 출력된 문자값으로 인해 AMF가 channel 오류를 발생시키는 것으로 보인다.

정리 하면 AMF통해 FLEX쪽으로 값을 넘길때 Service코드를 구현하게 되는데 이때는 리턴값외에 어떤값도 출력되어서는 안된다. PHP코드상의 에러가 없어야 함은 물론이다.

=> 해결이 어려울것으로 보이는 문제였기에 기록한다.

'파란코드 > 알짜' 카테고리의 다른 글

음 좋아요.. 이렇게 구분하지.  (2) 2007.05.09

추상적이지 않게 구체적으로 주석을 달자.

전통적인 주석 표기문 (#FIXME, #TODO, #XXX)을 활용하자.

FIXME : 코드를 고쳐야 하는데 자신이 고칠 수 없거나 시간이 없어서 그냥 지나친 부분을 나타낸다.
TODO: 앞으로 코드를 어떻게 발전시키고 싶은지에 대한 내용.
XXX: 뭔가 잘못된 부분이 있는 것 같은 느낌을 주는 부분

원문 : http://tdd.or.kr