Event listeners on incoming socket stream
-
Monday, March 12, 2012 5:58 AM
Hi,
I have a streamsocket that needs to listen for incoming messages from a server. Upon receiving a certain message, say X, it needs to trigger an event. Is there any way to create an event listener on an incoming socket stream? This is being done in C# for a metro app.
Thanks in advance.
V
All Replies
-
Tuesday, March 13, 2012 5:45 AMModerator
Hi,
It seems no available event trigger in StreamSocket for incoming message from tcp server.
To trigger data arrival event, you can choose MessageWebSocket and handle the MessageReceived event which indicates that a message was received.
Otherwise, you can use DatagramSocket and handle the MessageReceived event.
Best wishes,
Robin [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Robin_YangMicrosoft Employee, Moderator Tuesday, March 13, 2012 9:11 AM
- Proposed As Answer by Matt SmallMicrosoft Employee, Moderator Thursday, March 15, 2012 1:35 PM
- Marked As Answer by Robin_YangMicrosoft Employee, Moderator Friday, April 06, 2012 1:25 AM


