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: 2.4.12.0
Syntax

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

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

VB
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)
  Else
    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 );
  else
    Console.Writeln( "Disconnected: {0} at {1}", ip, DateTime.Now );
}
See Also

Reference