Shouqin Huo <firstname.lastname@example.org> wrote:
“Wojtek Lerch” <> email@example.com> > wrote in message
news:b28dl6$a76$> firstname.lastname@example.org> …
Shouqin Huo <> email@example.com> > wrote:
Now I got the channel number by calling PtChannelCreate(). However, when
sent the pulse using MsgPulseSend, the pulse was received by the sender,
the receiver. This is very strange.
How are you creating the connection you’re sending the pulse to?
First I called PtChannelCreate and PhChannelAttach. Then I send the channel
PtChannelCreate and PhChannelAttach?
That’s not necessary. Both do the same thing. If you call
PhChannelAttach() after you have created a channel, it will either do
nothing and fail, or do nothing and succeed, depending on whether you
give it a conflicting channel or connection ID or not.
In a program that uses the Pt functions to read events from Photon, just
call PtChannelCreate(). PhChannelAttach() is meant for applications
that must create their own channel or use an unusual method of event
notification – but since we don’t really document how to do that
without breaking the Pt-level stuff, it’s only really safe in apps that
don’t use the Pt-level stuff.
ID and pid to the non-photon application. The non-photon application first
uses the pid and channel id to create a connection id by calling
ConnectAttach(). After that, the pulses are generated by calling
I tested the mechanism with two non-photon applications. I got the same
results, i.e. the sender got the pulse, not the intended receiver. So it
seems I’m doing something wrong with the non-photon application.
For the purpose of the test, the non-photon application doesn’t even
need to have a channel – have you tried a simple test where the Photon
app prints out its pid and channel ID, and you then pass them to the
non-Photon app on command line? If the non-Photon app doesn’t have a
channel, there’s no way the pulses will be sent to it, right?..