On 2023-09-11 11:35, kevin@limping.ninja wrote:
On 11 Sep 2023, at 17:29, Chris Angelico <ros...@gmail.com> wrote:

On Tue, 12 Sept 2023 at 01:25, <kevin@limping.ninja> 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, both bind and Stdio.Port instantiation with the callback silently fail to execute the callback it seems. I get the connection, but the callback is never fired. At this point I stripped everything back just simply trying to make a basic echo server. I forgot how much the documents
assert knowledge and forgot much of my own knowledge on Pike.

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 lots of code that uses Stdio.Port and it's mostly unchanged from the 7.2/7.6 era. I don't think I've ever used set_accept_callback(), mostly because it's never seemed more convenient than doing it using bind().

I can confirm that Stdio.Port on 8.0.1738 does not have a definition for set_accept_callback(), which is strange because (at least) the 7.8 SSL file object uses it.

An example that I know works:

https://hg.sr.ht/~hww3/pikon/browse/Pikon.pmod/remote_access.pike?rev=tip

Bill

Reply via email to