> 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()
>>
>
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
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
I had some old code lying around from 7.2 and just decided to test it and it
failed miserably. I wrote a few different reproductions, mainly around using
Port.bind() and .set_accept_callback() trying to get things to work. Basically:
Stdio.Port mainsock;
class Connection() {…}
void
> 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
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,
> 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
> 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