BadScript 2
Loading...
Searching...
No Matches
BadNetHostApi.cs
Go to the documentation of this file.
4
6
10[BadInteropApi("NetHost")]
11internal partial class BadNetHostApi
12{
13 [BadMethod(description: "Creates a new NetHost Instance")]
14 [return: BadReturn("The NetHost Instance")]
15 private BadTable Create([BadParameter(description: "Array of string prefixes")] string[] prefixes)
16 {
17 BadNetHost host = new BadNetHost(prefixes);
18 BadTable table = new BadTable();
19 table.SetFunction("Start", host.Start);
20 table.SetFunction("Stop", host.Stop);
21 table.SetFunction("Close", host.Close);
22 table.SetFunction("Abort", host.Abort);
23 table.SetFunction("AcceptClient", host.AcceptClient, BadTask.Prototype);
24
25 return table;
26 }
27}
Implements a Task Object.
Definition BadTask.cs:17
static readonly BadClassPrototype Prototype
The BadTask Prototype.
Definition BadTask.cs:21
Implements the "NetHost" Api.
BadTable Create([BadParameter(description:"Array of string prefixes")] string[] prefixes)
Implements a BadScript HttpListener Host.
Definition BadNetHost.cs:14
void Close()
Close the Listener.
void Start()
Starts the Listener.
Definition BadNetHost.cs:84
void Abort()
Aborts the Listener.
void Stop()
Stops the Listener.
Definition BadNetHost.cs:92
static IEnumerator< BadObject > AcceptClient(HttpListener listener, Action< BadObject > callback)
Accepts a Client.
Definition BadNetHost.cs:38
Implements an Interop API for the BS2 Language.
Implements a Table Structure for the BadScript Language.
Definition BadTable.cs:14
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
Contains Network Hosting Extensions and APIs for the BadScript2 Runtime.
Contains the Extension Classes for Functions.
Contains the Runtime Objects.
Definition BadArray.cs:10