Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 27 |
Nodes: | 6 (0 / 6) |
Uptime: | 38:51:35 |
Calls: | 631 |
Calls today: | 2 |
Files: | 1,187 |
D/L today: |
23 files (29,781K bytes) |
Messages: | 174,060 |
$ pas s3
$ link/thread s3 + pzmqdir:pzmq + pzmqdir:common + zmq$root:[lib]libzmq64/lib
ctx := zmq_ctx_new;
s := zmq_socket(ctx, ZMQ_REQ);
zmq_connect(s, 'tcp://localhost:10000');
On Sat, 13 Sep 2025 10:07:28 -0400, Arne Vajh|+j wrote:
ctx := zmq_ctx_new;
s := zmq_socket(ctx, ZMQ_REQ);
zmq_connect(s, 'tcp://localhost:10000');
Are errors automatically signalled?
On 9/13/2025 5:58 PM, Lawrence DrCOOliveiro wrote:
On Sat, 13 Sep 2025 10:07:28 -0400, Arne Vajh|+j wrote:
ctx := zmq_ctx_new;
s := zmq_socket(ctx, ZMQ_REQ);
zmq_connect(s, 'tcp://localhost:10000');
Are errors automatically signalled?
No.
It returns an integer with status.
I just didn't test on it.
On Sat, 13 Sep 2025 18:43:22 -0400, Arne Vajh|+j wrote:
On 9/13/2025 5:58 PM, Lawrence DrCOOliveiro wrote:
On Sat, 13 Sep 2025 10:07:28 -0400, Arne Vajh|+j wrote:
ctx := zmq_ctx_new;
s := zmq_socket(ctx, ZMQ_REQ);
zmq_connect(s, 'tcp://localhost:10000');
Are errors automatically signalled?
No.
It returns an integer with status.
I just didn't test on it.
Ironic, isnrCOt it? Here we have a platform, one of whose core
distinguishing features is its elaborate, cross-language exception-
handling system, and this library doesnrCOt make any use of it.
$ pas s3
$ link/thread s3 + pzmqdir:pzmq + pzmqdir:common + zmq$root:
[lib]libzmq64/lib
/thread is not strictly needed, but without it breaking the
infinite loop with CTRL/Y exits a bit hard.
On 9/13/25 16:11, Arne Vajh|+j wrote:
$ pas s3
$ link/thread s3 + pzmqdir:pzmq + pzmqdir:common + zmq$root:
[lib]libzmq64/lib
/thread is not strictly needed, but without it breaking the
infinite loop with CTRL/Y exits a bit hard.
/THREAD enables upcalls and multiple kernel threads.
The linker was changed to enable Upcalls whenever it sees that threads
are used and no /THREAD was given. In this case the linker prints an informational message.
If you link without /THREAD, do you see the linker message?
The shown "Upcalls are disabled. Multiple kernel threads are disabled" indicates
you did not.
If you do not see the message, then I assume the threaded code is in a shareable image. The linker does not check whether threads are used in shareables.-a From the shown link command I don't see that a threaded shareable image is involved.
It would be interesting to know whether /THREAD=UPCALLS is enough to
make this work. I suspect it is.
Do you have any idea where threaded code is used?
What is ICTX?
On 9/15/2025 7:14 AM, hb0815 wrote:
Do you have any idea where threaded code is used?
The only library being used is libzmq, so it must be it.
And the upstream repo confirms that:
https://github.com/zeromq/libzmq/blob/master/src/thread.hpp
The only library being used is libzmq, so it must be it.
And the upstream repo confirms that:
-a https://github.com/zeromq/libzmq/blob/master/src/thread.hpp
On 9/13/2025 5:58 PM, Lawrence DrCOOliveiro wrote:
On Sat, 13 Sep 2025 10:07:28 -0400, Arne Vajh|+j wrote:
-a-a-a-a ctx := zmq_ctx_new;
-a-a-a-a s := zmq_socket(ctx, ZMQ_REQ);
-a-a-a-a zmq_connect(s, 'tcp://localhost:10000');
Are errors automatically signalled?
No.
It returns an integer with status.
I just didn't test on it.
Instead of:
retval := zmq_connect(s, addr);
if retval <> 0 then begin
writeln('error');
end;
it is now possible to do:
retval := zmq_connect(s, addr);
if retval <> 0 then begin
e := errno; writeln(strerror(e));
end;
or even:
retval := zmq_connect(s, addr);
if retval <> 0 then begin
e := errno;
if e <> EVMSERR then begin
writeln(strerror(e));
end else begin
e := vmserrno; writeln(strvmserror(e));
end;
end;
On Thu, 18 Sep 2025 20:21:51 -0400, Arne Vajh|+j wrote:
Instead of:
retval := zmq_connect(s, addr);
if retval <> 0 then begin
writeln('error');
end;
it is now possible to do:
retval := zmq_connect(s, addr);
if retval <> 0 then begin
e := errno; writeln(strerror(e));
end;
or even:
retval := zmq_connect(s, addr);
if retval <> 0 then begin
e := errno;
if e <> EVMSERR then begin
writeln(strerror(e));
end else begin
e := vmserrno; writeln(strvmserror(e));
end;
end;
Does perror(3) take care of this for you?
On 9/18/2025 10:17 PM, Lawrence DrCOOliveiro wrote:
Does perror(3) take care of this for you?
I do not have any intention of wrap perror - it is a very specific
composite function.
On Fri, 19 Sep 2025 08:26:43 -0400, Arne Vajh|+j wrote:
On 9/18/2025 10:17 PM, Lawrence DrCOOliveiro wrote:
Does perror(3) take care of this for you?
I do not have any intention of wrap perror - it is a very specific
composite function.
Then the problem is that you have to repeat that long sequence of code in every project.
On 9/19/2025 8:35 PM, Lawrence DrCOOliveiro wrote:
Then the problem is that you have to repeat that long sequence of
code in every project.
If a big application were to use this, then they will have to add a
library function for it or more likely they already have one.
But the implementation will likely be different for different
places.
Target: SYS$OUTPUT, SYS$ERROR, syslog or something else.
Format: single text lines, JSON, XML or something else.
On Fri, 19 Sep 2025 21:15:06 -0400, Arne Vajh|+j wrote:
On 9/19/2025 8:35 PM, Lawrence DrCOOliveiro wrote:
Then the problem is that you have to repeat that long sequence of
code in every project.
If a big application were to use this, then they will have to add a
library function for it or more likely they already have one.
But the implementation will likely be different for different
places.
Target: SYS$OUTPUT, SYS$ERROR, syslog or something else.
Errors/diagnostics always go to stderr. Sure, you can explicitly
target syslog, but itrCOs easier nowadays to leave it to the service
manager infrastructure (e.g. systemd) to collect stderr from daemon
processes and save that to the system log. The less special-casing you
have to do to run as a daemon versus non-daemon, the better.
Format: single text lines, JSON, XML or something else.
Simple text lines. TheyrCOre meant to be human-readable, after all.
On 9/19/2025 10:03 PM, Lawrence DrCOOliveiro wrote:
Errors/diagnostics always go to stderr. Sure, you can explicitly
target syslog, but itrCOs easier nowadays to leave it to the service
manager infrastructure (e.g. systemd) to collect stderr from daemon
processes and save that to the system log. The less special-casing
you have to do to run as a daemon versus non-daemon, the better.
Format: single text lines, JSON, XML or something else.
Simple text lines. TheyrCOre meant to be human-readable, after all.
You know what you want. Fine.
But realize that other may have other preferences.
To me strerror seems like the right API since it does not impose any assumptions about log handling.