Skip to content

Functions (Threads)

CheshireCaat edited this page Feb 7, 2020 · 14 revisions

Running functions through threads is very similar to a regular launch through BasRemoteClient. The main feature of this type of launch is that you can control the launch yourself, stop the stream, and check whether it is busy with the execution of functions. This is very convenient as it gives you complete control over the execution of functions.

If you want to create new thread then use client.CreateThread() method. This method returns IBasThread interface, that contains several useful methods and properties. Take a look at example.

 var thread = client.CreateThread();

// Set up proxy.
await thread.RunFunction("SetProxy", new Params
{
    {"Proxy", "127.0.0.1:11185"},
    {"IsSocks5", true}
});

// Check the ip of this proxy.
var proxyIp = await thread.RunFunction("CheckIp", Params.Empty);

// Stop the thread.
thread.Stop();
Clone this wiki locally