Re: Syntax / Function callbacks

2023-09-11 Thread kevin
> On 11 Sep 2023, at 23:09, kevin@limping.ninja wrote: > > void accept_callback() > { > object tmp= listener->accept(); > if (!tmp) return; > object conn = Connection(tmp); > connections+=({conn}); > //destruct(tmp); <— this was disconnecting, but looking back at an old doc > from Hubbe, this

Re: Syntax / Function callbacks

2023-09-11 Thread kevin
> On 11 Sep 2023, at 19:16, will...@welliver.org wrote: > Just to be clear, when you specify the accept callback to bind() it never > gets called when you make a connection? What version of pike are you using? > Are you returning -1 from main() so that the backend is running? > > I've got

Re: Syntax / Function callbacks

2023-09-11 Thread william
On 2023-09-11 11:35, kevin@limping.ninja wrote: On 11 Sep 2023, at 17:29, Chris Angelico wrote: On Tue, 12 Sept 2023 at 01:25, wrote: The original state of the code had it using !bind(portnum, callbackfn) — those being actually port numbers and the accept_callback function. But as noted,

Re: Syntax / Function callbacks

2023-09-11 Thread kevin
> On 11 Sep 2023, at 17:29, Chris Angelico wrote: > > On Tue, 12 Sept 2023 at 01:25, wrote: >> >> It should do: >> https://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/_Stdio/_port/set_accept_callback.html >> >> It exists within the documentation…? also Stdio.Port mainsock

Re: Syntax / Function callbacks

2023-09-11 Thread Chris Angelico
On Tue, 12 Sept 2023 at 01:25, wrote: > > It should do: > https://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/_Stdio/_port/set_accept_callback.html > > It exists within the documentation…? also Stdio.Port mainsock = > Stdio.Port(, accept_callback) and if

Re: Syntax / Function callbacks

2023-09-11 Thread kevin
> On 11 Sep 2023, at 17:18, Chris Angelico wrote: > > On Tue, 12 Sept 2023 at 01:14, wrote: >> >> int main() { … mainsock->set_accept_callback(accept_callback); ... } >> >> Attempt to call the NULL-value >> Unknown program: 0(/main()->accept_callback) >> main.pike:53: /main()->main() >> >

Re: Syntax / Function callbacks

2023-09-11 Thread Chris Angelico
On Tue, 12 Sept 2023 at 01:14, wrote: > > int main() { … mainsock->set_accept_callback(accept_callback); ... } > > Attempt to call the NULL-value > Unknown program: 0(/main()->accept_callback) > main.pike:53: /main()->main() > Looks like it's not a syntax problem, but that there's no