BASS.NET API for the Un4seen BASS Audio LibraryCLIENTCONNECTPROC DelegateBASS.NET API for the Un4seen BASS Audio Library
User defined client connection notification callback function.

Namespace: Un4seen.Bass.AddOn.Wma
Assembly: Bass.Net (in Bass.Net.dll) Version:

public delegate void CLIENTCONNECTPROC(
	int handle,
	bool connect,
	string ip,
	IntPtr user


Type: SystemInt32
The encoder handle (as returned by BASS_WMA_EncodeSetNotify(Int32, CLIENTCONNECTPROC, IntPtr)).
Type: SystemBoolean
The client's IP address... "".
Type: SystemString
The client is connecting?
Type: SystemIntPtr
The user instance data given when BASS_WMA_EncodeSetNotify(Int32, CLIENTCONNECTPROC, IntPtr) was called.

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.


Private _myClientConnectProc As CLIENTCONNECTPROC
' set the notification callback
_myClientConnectProc = New CLIENTCONNECTPROC(AddressOf MyClientConnectNotify)
BassWma.BASS_WMA_EncodeSetNotify(encoder, _myClientConnectProc, IntPtr.Zero)
' the recording callback
Private Sub MyClientConnectNotify(handle As Integer, connect As Boolean, ip As String, user As IntPtr)
  If connect Then
    Console.Writeln("Connected: {0} at {1}", ip, DateTime.Now)
    Console.Writeln("Disconnected: {0} at {1}", ip, DateTime.Now)
  End If
End Sub
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 );
    Console.Writeln( "Disconnected: {0} at {1}", ip, DateTime.Now );
See Also