Back to product page

TextReceived event


Fires when text message arrives from remote side.

Syntax

  • C#
  • C++
  • VB.NET
delegate void devP2P.TextReceivedEvent(IntPtr Handle, int chanid, string text);
The TextReceived(Handle,chanid,text) syntax has these parts:
HandleReference to the devP2P instance.
chanidIndex of the channel where data arrived.
textString that was received from remote peer.

void TextReceived(CP2P *p2p, int chanid, char *text);
The TextReceived(p2p,chanid,text) syntax has these parts:
p2pPointer to devP2P instance that fired the event.
chanidIndex of the channel where data arrived.
textPointer to buffer in memory with the text.

Delegate Sub P2P_TextReceivedEvent(ByVal Handle As IntPtr, ByVal chanid As Integer, ByVal text As String)
The TextReceived(Handle,chanid,text) syntax has these parts:
HandleReference to the devP2P instance.
chanidIndex of the channel where data arrived.
textString that was received from remote peer.

Remarks

TextReceived event is fired when remote side uses SendText method to send us short text message. On local side you can show this text to your application, or you can use it to send/receive various short commands between devP2P peers, so that you can make certain custom actions.

If you want to send non-text (binary) data, use SendData method instead.

To use this event, you should implement function by yourself in the code (based on function declaration), and set devP2P.Events.TextReceived structure member to point to your function.

Platforms

Windows
Mac OSX
Linux
BSD