Photon application only getting pulse sometimes ?

Hi,
I have a photon client application and a non-photon server application. If I
run the client twice I get a Pulse from the server for each cient but after
that any clients started don’t get any pulses delivered. I wrote a couple of
test applications to show this, I have attached them to this email, I must
be doing something wrong ?

The MsgDeliverEvent is coming up with an error - No such process ? Yet the
process is alive as far as I can see, the pid is correct.

TIA, Brett


begin 666 server.c
M(VEN8VQU9&4@/’-T9&QI8BYH/@T*(VEN8VQU9&4@/’-T9&EO+F@^#0HC:6YC
M;‘5D92 \97)R;F\N:#X-"B-I;F-L=61E(#QS=’)I;F<N:#X-“B-I;F-L=61E
M(#QU;FES=&0N:#X-“B-I;F-L=61E(#QS>7,O;F5U=’)I;F\N:#X-“B-I;F-L
M=61E(#QS>7,O:6]F=6YC+F@^#0HC:6YC;'5D92 <WES+V1I<W!A=&-H+F@^
M#0H-“G1Y<&5D968@<W1R=6-T('L-“B @<&ED7W0@<&ED.PT*(”!I;G0@8VAI
M9#L-“GT@0VQI96YT.PT#0IT>7!E9&5F(’-T<G5C="![#0H@(‘5N:6]N(‘L-
M"B @("!S=’)U8W0@7W!U;’-E(’!U;’-E.PT
(” @($-L:65N=”!C.PT*(”!]
M.PT*?2!-97-S86=E.PT*#0IN86UE7V%T=&%C:%]TB!N83L-"@T:6YT(&UA
M:6XH:6YT(&%R9V,L(&-H87(@F%R9W9;72D@>PT(”!-97-S86=E(&EN.PT*
M(”!S=’)U8W0@7VUS9U]I;F9O(&EN9F[#0H@(&EN="!R8W9I9#L-“B @<W1R
M=6-T(’-I9V5V96YT(&5V96YT.PT*(”!I;G0@8V]I9#L-“B @#0H@(&EF(”@H
M;F$@/2!N86UE7V%T=&%C:“A.54Q,+” B4T525D52(BP@,“DI(#T]($Y53$PI
M('L-”@EP<FEN=&8H(E5N86)L92!T;R!A=‘1A8V@@;F%M95QN(BD#0H)<F5T
M=7)N($58251?4U5#0T534SL-“B @?0T*(”!F;W(H.SLI('L-“B @(”!R8W9I
M9"
E8V5I=F4H;F$M/F-H:60L(“9I;BP@<VEZ96]F*$UE<W-A9V4I
M+” F:6YF;RD[#0H@(" @:68@’)C=FED(#T]("TQ2![#0H@(" @("!P<FEN
M=&8H(DUS9U)E8V5I=F4@97)R;W)<;B(I.PT*(" @(" @8V]N=&EN=64#0H-
M"B @("!
C=FED(#T](# I(‘L-“B @(” @("\O(%!U;’-E
M(&AA<R!B965N(’)E8V5I=F5D#0H@(" @("!S=VET8V@@&EN+G!U;’-E+F-O
M9&4I('L-“B @(” @(" @8V%S92!?4%5,4T5?0T]$15]$25-#3TY.14-4.@T

M(" @(" @(" @(’!R:6YT9B@B1&5A=&@@;V8@8VQI96YT(“5D7&XB+”!I;BYP
M=6QS92YS8V]I9"D[#0H@(" @(" @(" @8G)E86L[#0H@(" @("!]#0H@(" @
M?2!E;’-E(‘L-"B @"2!F<’)I;G1F*’-T9&5R<BP@(DUE<W-A9V4@4F5C=F0@
M<&ED(“5D(&-H:60@)60@<V-O:60@)61<;B(L(“AI;G0I:6XN8RYP:60L(“AI
M;G0I:6XN8RYC:&ED+” H:6YT6EN9F\N<V-O:60I.PT(” )($US9U)E<&QY
M*’)C=FED+” P+" P+" P3L-"B @"2 -"B @“2!S;&5E<”@Q3L-"@T*(" @
M("!C;VED(#T@0V]N;F5C=$%T=&%C:"@P+"!I;BYC+G!I9"P@:6XN8RYC:&ED
M+"!?3E1/7U-)1$5?0TA!3DY%3"P@," I.PT*(" @("!I9B H8V]I9" ]/2 M
M,2D@>PT*(" @(" @(’!R:6YT9B@B8V]I9"!E<G)O<EQN(BD[#0H@(" @(‘T-
M"B @(" @4TE’159?4%5,4T5?24Y)5"@@)F5V96YT+"!I;F9O+G-C;VED+"!3
M24=%5E]054Q315]04DE/7TE.2$52250L(#,S+" P(“D[#0H@(” @(&EF("A-
M<V=$96QI=F5R179E;G0H<F-V:60L("9E=F5N=“D@/3T@+3$I('L-“B @(” @
M(”!F<’)I;G1F*’-T9&5R<BP@(FUS9V1E;&EV97)E=F5N="!F86EL960@+2 E
M<UQN(BP@<W1R97)R;W(H97)R;F\I3L-“B @(” @?0T(" @('T-“B @?0T*
=(” -"B @<F5T=7)N($58251?4U5#0T534SL-"GT
end

begin 666 client.c
M+RH@62!O(‘4@<B @($0@92!S(&,@<B!I(’ @="!I(&@;B @(" @(" @(" @
M(" @(" @(" @(" @B*+RH@(" @(" @(" @(" @(" @(" @(" @(" @(" @
M07!P0G5I;&1E<B!0:&]T;VX@0V]D92!,:6(@B*+RH@(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(%9E<G-I;VX@,BXP,2 @B*
M"B\J(%-T86YD87)D(&AE861E<G,@B*(VEN8VQU9&4@/’-T9&EO+F@^"B-I
M;F-L=61E(#QS=&1L:6(N:#X
(VEN8VQU9&4@/'5N:7-T9"YH/@HC:6YC;'5D
M92 <W1R:6YG+F@^"@HC:6YC;'5D92 <WES+VYE=71R:6YO+F@^"B-I;F-L
M=61E(#QS>7,O:6]F=6YC+F@^"B-I;F-L=61E(#QS>7,O9&ES<&%T8V@N:#X

M"B\J($QO8V%L(&AE861E<G,@B*(VEN8VQU9&4@(F%B;&EB<RYH(@HC:6YC
M;‘5D92 B86)I;7!OG0N:"(*(VEN8VQU9&4@(G!R;W1O+F@B"@IT7!E9&5F
M(’-T<G5C="![“B @<&ED7W0@<&ED.PH@(&EN=”!C:&ED.PI]($-L:65N=#L

M"G1Y<&5D968@<W1R=6-T('L
("!U;FEO;B![“B @(”!S=’)U8W0@7W!U;’-E
M(’!U;’-E.PH@(" @0VQI96YT(&,["B @?3L
?2!-97-S86=E.PH*<W1A=&EC
M(&EN="!->4US9TAA;F1L97(H=F]I9" J9&%T82P@:6YT(’)C=FED+"!V;VED
M(“IM97-S86=E+”!S:7IE7W0@<VEZ92D["@II;G0@26YI=%!R;V=R86TH(%!T
M5VED9V5T7W0@FQI;FM?:6YS=&%N8V4L($%P26YF;U]T(“IA<&EN9F\L(%!T
M0V%L;&)A8VM);F9O7W0@F-B:6YF;R I"GL(”!I;G0@8VAI9#L
("!I;G0@
M8V]I9#L*("!-97-S86=E(&]U=#L*(" (" OB!E;&EM:6YA=&4@)W5N<F5F
M97)E;F-E9"<@=V%R;FEN9W,@B*("!L:6YK7VEN<W1A;F-E(#T@;&EN:U]I
M;G-T86YC92P@87!I;F9O(#T@87!I;F9O+"!C8FEN9F@/2!C8FEN9F["@H@
M("\O(&5S=&%B;&ES:"!C:&%N;F5L(&ED"B @8VAI9" ](%!H0VAA;FYE;$%T
M=&%C:"@@,“P@+3$@+”!.54Q,(“D[”@H@("\O(&%D9"!M<V<@:&%N9&QE<@H@
M(%!T07!P061D26YP=70H($Y53$PL(# L($UY37-G2&%N9&QE<BP@3E5,3" I
M.PH
(" O+R!P87-S(&-H:60@=&@;F]N+7!H;W1O;B!A<’ (" O+R!E;G1E
M<B!M86EN(&QO;W ("!C;VED(#T@;F%M95]O<&5N")315)615(B+" P
3L*
M("!I9B H8V]I9" ]/2 M,2D@>PH@( EE>&ET*“TQ3L(”!]“B @;W5T+F,N
M<&ED(#T@9V5T<&ED*“D[“B @;W5T+F,N8VAI9” ](&-H:60[“B @37-G4V5N
M9"AC;VED+” F;W5T+”!S:7IE;V8H365S<V%G92DL(# L(# I.PH@(’)E='5R
M;B@@4’1?0T].5$E.544@3L?0H*<W1A=&EC(&EN=”!->4US9TAA;F1L97(H
M=F]I9" J9&%T82P@:6YT(’)C=FED+"!V;VED(“IM97-S86=E+”!S:7IE7W0@
M<VEZ92D*+R\JBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJ
MBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJ"B\OBHJ
MBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJBHJ
M
BHJBHJBHJBHJBHJBHJBHJBHJBHJ*@I[“B @8VAA<B!M<V=;-C1=
M.PH@(’-P<FEN=&8H;7-G+” B4F5C96EV960@;65S<V%G92(I.PH@(%!T4V5T
M4F5S;W5R8V4H04)77W1E>‘0L(%!T7T%21U]415A47U-44DE.1RP@*&QO;F<I
M)FUS9RP@,"D[“B @4’1&;'5S:”@I.PH@(’)E='5R;B@@4’1?0T].5$E.544@
%3L?0H
end

Brett Wilton <bdwilton@xtra.co.nz> wrote:

Hi,
I have a photon client application and a non-photon server application. If I
run the client twice I get a Pulse from the server for each cient but after
that any clients started don’t get any pulses delivered. I wrote a couple of
test applications to show this, I have attached them to this email, I must
be doing something wrong ?

The MsgDeliverEvent is coming up with an error - No such process ? Yet the
process is alive as far as I can see, the pid is correct.

You’re passing the server-side scoid as the second argument to
SIGEV_PULSE_INIT(). That’s wrong. It must be a client-side connection
id. In general, those two are completely different numbers.

Take a look at the MsgDeliverEvent() example in the docs. The client
must create a connection to its own channel and pass its coid to the
server, and that’s what the server should use for the sigev_coid.

Since your client is a Photon program, you can do all that by calling
PtAppCreatePulse() and PtPulseArm(). This will give you a complete
struct sigevent that the client can send to the server without looking
at its contents (and the server can then pass it to MsgDeliverEvent()
without looking at its contents). Also, the pulse “pid” will let you
attach a specific input proc, which allows you not to worry about
unrelated input procs interfering with each other.

Thanks for that, sometimes you just can’t see the wood from the tree’s.
It works like a dream now !

“Wojtek Lerch” <wojtek_l@yahoo.ca> wrote in message
news:bdf4f8$q3d$1@inn.qnx.com

Brett Wilton <> bdwilton@xtra.co.nz> > wrote:
Hi,
I have a photon client application and a non-photon server application.
If I
run the client twice I get a Pulse from the server for each cient but
after
that any clients started don’t get any pulses delivered. I wrote a
couple of
test applications to show this, I have attached them to this email, I
must
be doing something wrong ?

The MsgDeliverEvent is coming up with an error - No such process ? Yet
the
process is alive as far as I can see, the pid is correct.

You’re passing the server-side scoid as the second argument to
SIGEV_PULSE_INIT(). That’s wrong. It must be a client-side connection
id. In general, those two are completely different numbers.

Take a look at the MsgDeliverEvent() example in the docs. The client
must create a connection to its own channel and pass its coid to the
server, and that’s what the server should use for the sigev_coid.

Since your client is a Photon program, you can do all that by calling
PtAppCreatePulse() and PtPulseArm(). This will give you a complete
struct sigevent that the client can send to the server without looking
at its contents (and the server can then pass it to MsgDeliverEvent()
without looking at its contents). Also, the pulse “pid” will let you
attach a specific input proc, which allows you not to worry about
unrelated input procs interfering with each other.