User defined client connection notification callback function.
Namespace: Un4seen.Bass.AddOn.Wma
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
Parameters
- handle
- Type: SystemInt32
The encoder handle (as returned by BASS_WMA_EncodeSetNotify(Int32, CLIENTCONNECTPROC, IntPtr)). - connect
- Type: SystemBoolean
The client's IP address... "xxx.xxx.xxx.xxx:port". - ip
- Type: SystemString
The client is connecting? - user
- Type: SystemIntPtr
The user instance data given when BASS_WMA_EncodeSetNotify(Int32, CLIENTCONNECTPROC, IntPtr) was called.
Remarks
A client connection notification can be used to keep track of who's connected, where they're from, and for long they've been connected.
NOTE: When you pass an instance of a callback delegate to one of the BASS functions, this delegate object will not be reference counted. This means .NET would not know, that it might still being used by BASS. The Garbage Collector might (re)move the delegate instance, if the variable holding the delegate is not declared as global. So make sure to always keep your delegate instance in a variable which lives as long as BASS needs it, e.g. use a global variable or member.
Examples
private CLIENTCONNECTPROC _myClientConnectProc; ... // set the notification callback _myClientConnectProc = new CLIENTCONNECTPROC(MyClientConnectNotify); BassWma.BASS_WMA_EncodeSetNotify(encoder, _myClientConnectProc, IntPtr.Zero); ... // the recording callback private void MyClientConnectNotify(int handle, bool connect, string ip, IntPtr user) { if (connect) Console.Writeln( "Connected: {0} at {1}", ip, DateTime.Now ); else Console.Writeln( "Disconnected: {0} at {1}", ip, DateTime.Now ); }
See Also