Discussion:
PATHSEND/SERVERCLASS SEND procedure from C
(too old to reply)
uros kusar
2021-05-28 07:06:17 UTC
Permalink
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?

This is the code that I'm working on:
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>

main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;

pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";

error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */

if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
Response:
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12

Best Regards,
Uros
Keith Dick
2021-05-28 17:08:20 UTC
Permalink
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
I see two coding errors in the program you included, but I cannot say whether either of them explains why the program is not working.

One coding error is that you do not check the error return from SERVERCLASS_SEND_INFO_. If something was wrong with that call to SERVERCLASS_SEND_INFO_, the values you are displaying for pathsend error and fs error might not be true, thereby misleading you about what went wrong with the SERVERCLASS_SEND_ call.

Assuming that nothing went wrong in the SERVERCLASS_SEND_INFO_ call, the errors were 904 and 12. The 904 says that there was an error when making the link to the server. Filesystem error 12 is the generic 'file in use' error when returned from an open of a disk file, but I'm not sure how to interpret it for a failure of a link request. If we dug into the description of link management, maybe there would be a description of what error 12 means in that context, but I did not take the time to do that right now.

The other coding error is in the SERVERCLASS_SEND_ call. I am not sure it is the cause of the SERVERCLASS_SEND_ failure, but the first thing I would do is fix it and see whether that changes how the program works.

The problem is that the SERVERCLASS_SEND_ call says that the buffer argument can accept a reply of 200 characters, but that is not how you declared buffer. You declared buffer to be a char*, then initialized it to point to the string constant

"STATUS PROCESS P1A^BICUNI1"

SERVERCLASS_SEND_ puts the reply into the same buffer from which it took the outgoing message. So in your program, if it actually got a reply, it would try to store it into the memory where "STATUS PROCESS P1A^BICUNI1" is. At the very least, that will destroy the supposedly constant value of that string. It might not be able to write into that storage if the compiler sets up string constants in a read-only memory segment. If the compiler sets up the string constant in a writable memory segment, storing the reply there could overwrite whatever data is stored following that string constant, since it is nowhere near 200 bytes long.

So change your program to declare buffer to be a 200-byte array, and put the string constant into it using strcpy(). Then see whether you get a more sensible result. If you still get an error, post again and we can dig into how filesystem error 12 on a link request is supposed to be interpreted.
Randall
2021-05-28 18:51:20 UTC
Permalink
Post by Keith Dick
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
I see two coding errors in the program you included, but I cannot say whether either of them explains why the program is not working.
One coding error is that you do not check the error return from SERVERCLASS_SEND_INFO_. If something was wrong with that call to SERVERCLASS_SEND_INFO_, the values you are displaying for pathsend error and fs error might not be true, thereby misleading you about what went wrong with the SERVERCLASS_SEND_ call.
Assuming that nothing went wrong in the SERVERCLASS_SEND_INFO_ call, the errors were 904 and 12. The 904 says that there was an error when making the link to the server. Filesystem error 12 is the generic 'file in use' error when returned from an open of a disk file, but I'm not sure how to interpret it for a failure of a link request. If we dug into the description of link management, maybe there would be a description of what error 12 means in that context, but I did not take the time to do that right now.
The other coding error is in the SERVERCLASS_SEND_ call. I am not sure it is the cause of the SERVERCLASS_SEND_ failure, but the first thing I would do is fix it and see whether that changes how the program works.
The problem is that the SERVERCLASS_SEND_ call says that the buffer argument can accept a reply of 200 characters, but that is not how you declared buffer. You declared buffer to be a char*, then initialized it to point to the string constant
"STATUS PROCESS P1A^BICUNI1"
SERVERCLASS_SEND_ puts the reply into the same buffer from which it took the outgoing message. So in your program, if it actually got a reply, it would try to store it into the memory where "STATUS PROCESS P1A^BICUNI1" is. At the very least, that will destroy the supposedly constant value of that string. It might not be able to write into that storage if the compiler sets up string constants in a read-only memory segment. If the compiler sets up the string constant in a writable memory segment, storing the reply there could overwrite whatever data is stored following that string constant, since it is nowhere near 200 bytes long.
So change your program to declare buffer to be a 200-byte array, and put the string constant into it using strcpy(). Then see whether you get a more sensible result. If you still get an error, post again and we can dig into how filesystem error 12 on a link request is supposed to be interpreted.
That's a really good catch. This is a very common coding error. The buffer used for SERVERCLASS_SEND_ also cannot be used for any other purpose while the message is being processed (same applies to WRITEREAD[XL]. It is, essentially locked, although that is not enforced by the CRE. There was a SETMODE for IPC communication but that significantly slows down your application and can eat up PFS space. Protecting buffer space during IPC operations is really important as a design consideration, particularly with IPC being implemented using DMA. A little known thing is that this can also apply to some esoteric threaded PUT socket operations. Buffer protection is critical for very high performance applications (as people who have seen the jelly bean challenge will remember - can't give more details).

An error 12 is usually returned by the server based on the number of opens/LINKDEPTH. If your server is coded to accept only one open, then you can encounter this. Check your XPNet configuration - it may be limiting opens in this situation.
Bill Honaker
2021-05-28 19:48:59 UTC
Permalink
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,

Keith and Randall gave very valuable responses.

Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.

Bill
Keith Dick
2021-05-28 20:22:58 UTC
Permalink
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,

Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
uros kusar
2021-05-31 11:07:05 UTC
Permalink
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,

Thank you all for your help.

I changed the code:
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.

It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVER-NCP:
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21

SERVER-NCP-1A:
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12

I think that the correct server is a SERVER-NCP.

---------------------------------------------------------------------------------------------------------------------------------------------
Pahway server configuration:
MAXLINKMONS 20 [CURRENTLY 2]

SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)

SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
code:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;

pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");

error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));

int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
Keith Dick
2021-05-31 13:57:14 UTC
Permalink
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
Filesystem error 21 usually means an illegal count was specified. That might mean that either the length of the buffer you are sending is wrong or the maximum reply size (200 in this case) is wrong. It might mean something else, since I don't know anything about XPNET.

Pathway servers usually take input as data structures with fixed-length fields, not a text string like you would type to a command interpreter. Are you sure that the server you are sending to is expected a text string as its input? Do you have any documentation of what this server's interface is?

I notice that, although you show a new program that displays the value of error2, the output that you show does not include the line that would show the value of error2. Did you omit showing it because its value was 0, or are you showing output from a different version of your program?
Randall
2021-05-31 17:37:21 UTC
Permalink
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
Filesystem error 21 usually means an illegal count was specified. That might mean that either the length of the buffer you are sending is wrong or the maximum reply size (200 in this case) is wrong. It might mean something else, since I don't know anything about XPNET.
Pathway servers usually take input as data structures with fixed-length fields, not a text string like you would type to a command interpreter. Are you sure that the server you are sending to is expected a text string as its input? Do you have any documentation of what this server's interface is?
I notice that, although you show a new program that displays the value of error2, the output that you show does not include the line that would show the value of error2. Did you omit showing it because its value was 0, or are you showing output from a different version of your program?
I too do not remember much about XPNet, but I thought it was not SERVERCLASS_SEND_ compatible - in particular, does not require a qualified name on the Open, like $XPN.#XPNET?
Keith Dick
2021-05-31 18:27:45 UTC
Permalink
Post by Randall
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
Filesystem error 21 usually means an illegal count was specified. That might mean that either the length of the buffer you are sending is wrong or the maximum reply size (200 in this case) is wrong. It might mean something else, since I don't know anything about XPNET.
Pathway servers usually take input as data structures with fixed-length fields, not a text string like you would type to a command interpreter. Are you sure that the server you are sending to is expected a text string as its input? Do you have any documentation of what this server's interface is?
I notice that, although you show a new program that displays the value of error2, the output that you show does not include the line that would show the value of error2. Did you omit showing it because its value was 0, or are you showing output from a different version of your program?
I too do not remember much about XPNet, but I thought it was not SERVERCLASS_SEND_ compatible - in particular, does not require a qualified name on the Open, like $XPN.#XPNET?
Given that Uros' most recent post shows a Pathway configuration, whatever he is trying to communicate with appears to be a Pathway serverclass and so should be able to accept a request sent by SEVERCLASS_SEND_. Pathway servers usually don't accept free format text strings as request messages, but I don't immediately recall anything that would prevent one from being written to accept that. I believe the reply messages must have a 16-bit reply code as the first two bytes, at least if it is to be usable from Screen COBOL, but i don't believe there is any similar constraint on the request messages.
Bill Honaker
2021-05-31 19:59:27 UTC
Permalink
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
I see the original server was setup with 'Asoociative On' It's possible the open table in the server can't accept another open.

Can't explain the error 21.
Dave Bossi
2021-06-01 12:09:59 UTC
Permalink
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
I see the original server was setup with 'Asoociative On' It's possible the open table in the server can't accept another open.
Can't explain the error 21.
I would try changing PMON and SNAME from pointers to arrays and see if it doesn't help with the error 21.

char pmon[] = "$D1NM";
char sname[] = "SERVER-NCP";

Dave
uros kusar
2021-06-02 08:54:13 UTC
Permalink
Post by Dave Bossi
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
I see the original server was setup with 'Asoociative On' It's possible the open table in the server can't accept another open.
Can't explain the error 21.
I would try changing PMON and SNAME from pointers to arrays and see if it doesn't help with the error 21.
char pmon[] = "$D1MN";
char sname[] = "SERVER-NCP";
Dave
Hi,

Keith, I don't find anything in the manuals, that would show me what to send to the server.

I did not post the complete output to make this thread readable as possible. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data types, also arrays instead of pointers. The result is the same. I'm almost sure that I need to send command to the SERVER-NCP server instead the SERVER-NCPI-1A.

Currently I'm using arrays:

char pmon[5]={0};
char buffer [200]={0};
char sname[20]={0};

strcpy(pmon,"$D1MN");
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");

error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */

OUTPUT:
SERVERCLASS_SEND_INFO error = 0
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21

Buffer size = 26
STATUS PROCESS P1A^BICUNI1


EMS messages:

21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP

21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6
DEV1VHS:
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.

I'm losing ideas what else to try.

Uros
uros kusar
2021-06-02 09:42:12 UTC
Permalink
Post by uros kusar
Post by Dave Bossi
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
I see the original server was setup with 'Asoociative On' It's possible the open table in the server can't accept another open.
Can't explain the error 21.
I would try changing PMON and SNAME from pointers to arrays and see if it doesn't help with the error 21.
char pmon[] = "$D1MN";
char sname[] = "SERVER-NCP";
Dave
Hi,
Keith, I don't find anything in the manuals, that would show me what to send to the server.
I did not post the complete output to make this thread readable as possible. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data types, also arrays instead of pointers. The result is the same. I'm almost sure that I need to send command to the SERVER-NCP server instead the SERVER-NCPI-1A.
char pmon[5]={0};
char buffer [200]={0};
char sname[20]={0};
strcpy(pmon,"$D1MN");
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
SERVERCLASS_SEND_INFO error = 0
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
Buffer size = 26
STATUS PROCESS P1A^BICUNI1
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.
I'm losing ideas what else to try.
Uros
I just notice another EMS error in collector $0

21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21

Uros
Keith Dick
2021-06-02 12:55:12 UTC
Permalink
Post by uros kusar
Post by uros kusar
Post by Dave Bossi
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
I see the original server was setup with 'Asoociative On' It's possible the open table in the server can't accept another open.
Can't explain the error 21.
I would try changing PMON and SNAME from pointers to arrays and see if it doesn't help with the error 21.
char pmon[] = "$D1MN";
char sname[] = "SERVER-NCP";
Dave
Hi,
Keith, I don't find anything in the manuals, that would show me what to send to the server.
I did not post the complete output to make this thread readable as possible. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data types, also arrays instead of pointers. The result is the same. I'm almost sure that I need to send command to the SERVER-NCP server instead the SERVER-NCPI-1A.
char pmon[5]={0};
char buffer [200]={0};
char sname[20]={0};
strcpy(pmon,"$D1MN");
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
SERVERCLASS_SEND_INFO error = 0
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
Buffer size = 26
STATUS PROCESS P1A^BICUNI1
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.
I'm losing ideas what else to try.
Uros
I just notice another EMS error in collector $0
21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
Uros
Hi Uros,

Do you have any indication that the Pathway server you are trying to use is intended for a user such as yourself to access directly using SERVERCLASS_SEND_ ? You mentioned that you found a TAL program that sends commands to SERVER-NCP. Where did you find that example program? Perhaps if I looked at that TAL program, it would help me understand what you could be doing wrong.

I have a feeling that you are trying to do something that a user such as you is not intended to do, and that whatever task you are trying to do needs to be approached in some other way. That is only my feeling, based on very little evidence, so don't give up on this program based only on my feeling, because my feeling could be wrong. As I said earlier, I know nothing about xpnet.
Randall
2021-06-02 18:42:13 UTC
Permalink
Post by Keith Dick
Post by uros kusar
Post by uros kusar
Post by Dave Bossi
Post by uros kusar
Post by Bill Honaker
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
----------------------------------------------------------------------------------------------------------------
include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
#include <tal.h>
main()
{
short error, error2,pserror, fserror,countread;
char *pmon;
char *buffer;
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCPI-1A";
buffer ="STATUS PROCESS P1A^BICUNI1";
error = SERVERCLASS_SEND_ (pmon,
(short) strlen(pmon), /* pathmon */
sname,
(short) strlen(sname), /* server class */
buffer,
(short) strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf ("\nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n", error, pserror, fserror);
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
----------------------------------------------------------------------------------------------------------------
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
Best Regards,
Uros
Uros,
Keith and Randall gave very valuable responses.
Also one other possibility is that, in creating the link, the PATHMON tried to start a server process.
If that server process has a fixed PROCESS NAME for each isntance, and if there is already a running process with that name,
the attempt to start the process would get an error 12. Look at the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and
check what is in the "PROCESS". If it's present, there will either be one process name, or a list in paraentheses.
From a TACL prompt, issue a status command for each process in the list.
Bill
Bill,
Very good remembering that filesystem error 12 is used for attempting to start a process with a name that already exists. I should have remembered that myself. Unless Pathway's link management also uses filesystem error 12 for other problems, I'd say a duplicate process name is likely to be the explanation for this problem. Perhaps Uros has set up a test environment by duplicating the configuration of an existing environment and did not know to change the configured fixed server process names.
Hi,
Thank you all for your help.
1) I added SERVERCLASS_SEND_INFO output error number to see if command was succsesfully processed.
2) I changed the buffer to a 200-byte array.
3) I find some tal example of a similar program and I noticed that this tal program, sends the command to a different pathway server. I send it to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal program sends the command to the server SERVER-NCP, which sees all "node" servers.
It is interesting because if I send a command to SERVER-NCP I get a different error code.
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 12
I think that the correct server is a SERVER-NCP.
---------------------------------------------------------------------------------------------------------------------------------------------
MAXLINKMONS 20 [CURRENTLY 2]
SERVER SERVER-NCPI-1A
LINKDEPTH 1
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1AU (ASSOCIATIVE ON)
SERVER SERVER-NCP
LINKDEPTH 32
MAXLINKS 32
MAXSERVERS 3
PROCESS $D1C1
PROCESS $D1C2
PROCESS $D1C3
---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <tal.h>
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> nolist
main()
{
short error, error2, pserror, fserror,countread;
char *pmon;
char buffer [200]={0};
char *sname;
pmon ="$D1MN";
sname = "SERVER-NCP";
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
if (error != 0)
{
error2 = SERVERCLASS_SEND_INFO_ (&pserror, &fserror);
printf("\nSERVERCLASS_SEND_INFO error = %d \nSERVERCLASS_SEND_ error = %d, pathsend error = %d, fs error = %d\n",error2, error, pserror, fserror);
printf("\nBuffer size = %d\n", strlen(buffer));
int i;
for(i=0; i<strlen(buffer); i++)
{
printf("%c",buffer[i]);
}
printf("\n\n\n");
exit (1);
}
else
{
buffer [countread] = 0;
printf ("\nReply = %s\n", buffer);
}
}
I see the original server was setup with 'Asoociative On' It's possible the open table in the server can't accept another open.
Can't explain the error 21.
I would try changing PMON and SNAME from pointers to arrays and see if it doesn't help with the error 21.
char pmon[] = "$D1MN";
char sname[] = "SERVER-NCP";
Dave
Hi,
Keith, I don't find anything in the manuals, that would show me what to send to the server.
I did not post the complete output to make this thread readable as possible. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data types, also arrays instead of pointers. The result is the same. I'm almost sure that I need to send command to the SERVER-NCP server instead the SERVER-NCPI-1A.
char pmon[5]={0};
char buffer [200]={0};
char sname[20]={0};
strcpy(pmon,"$D1MN");
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");
error = SERVERCLASS_SEND_ (pmon,
(short)strlen(pmon), /* pathmon */
sname,
(short)strlen(sname), /* server class */
buffer,
(short)strlen(buffer),
200,
&countread,
-1); /* timeout = forever */
SERVERCLASS_SEND_INFO error = 0
SERVERCLASS_SEND_ error = 233, pathsend error = 904, fs error = 21
Buffer size = 26
STATUS PROCESS P1A^BICUNI1
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.
I'm losing ideas what else to try.
Uros
I just notice another EMS error in collector $0
21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
Uros
Hi Uros,
Do you have any indication that the Pathway server you are trying to use is intended for a user such as yourself to access directly using SERVERCLASS_SEND_ ? You mentioned that you found a TAL program that sends commands to SERVER-NCP. Where did you find that example program? Perhaps if I looked at that TAL program, it would help me understand what you could be doing wrong.
I have a feeling that you are trying to do something that a user such as you is not intended to do, and that whatever task you are trying to do needs to be approached in some other way. That is only my feeling, based on very little evidence, so don't give up on this program based only on my feeling, because my feeling could be wrong. As I said earlier, I know nothing about xpnet.
At this point, I would try putting together a trivial program in C/TAL that does a FILE_OPEN_, WRITEREADX, FILE_CLOSE_ to the process and see what error you actually get instead of trying to work through LINKMON. At least you have exact control with that and can see whether the FILE_OPEN_ fails, or whether the WRITEREADX is having a problem with your buffer.

Something you need to be aware of in your program, however. Your statement:

strcpy(pmon,"$D1MN");

is going to overrun your buffer and hit the next variable in memory. You only declared the buffer as char[5] and the copy is moving 6 bytes.

Cheers,
Randall
JShepherd
2021-06-02 19:03:39 UTC
Permalink
On Monday, May 31, 2021 at 3:59:31 PM UTC-4, Bill Honaker wrote:=20
com> wrote:=20
=20
sala:=20
On Friday, May 28, 2021 at 12:49:03 PM UTC-7, Bill Honaker wrote:=
=20
mail.com> wrote:=20
=20
Hi,=20
I'm writing C program that would get the status of the xpnet ob=
jects (stations,processes,node...). I'm using procedures described in the H=
P manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide.=
..) but I can't get anyting from Pathway except errors. Can you tell me wha=
t am I doing wrong?=20
=20
This is the code that I'm working on:=20
---------------------------------------------------------------=
-------------------------------------------------=20
include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)>=
nolist=20
#include <tal.h>=20
=20
main()=20
{=20
short error, error2,pserror, fserror,countread;=20
char *pmon;=20
char *buffer;=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCPI-1A";=20
buffer =3D"STATUS PROCESS P1A^BICUNI1";=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short) strlen(pmon), /* pathmon */=20
sname,=20
(short) strlen(sname), /* server class */=20
buffer,=20
(short) strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf ("\nSERVERCLASS_SEND_ error =3D %d, pathsend error =3D =
%d, fs error =3D %d\n", error, pserror, fserror);=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
---------------------------------------------------------------=
-------------------------------------------------=20
Response:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs err=
or =3D 12=20
=20
Best Regards,=20
Uros=20
Uros,=20
=20
Keith and Randall gave very valuable responses.=20
=20
Also one other possibility is that, in creating the link, the PA=
THMON tried to start a server process.=20
If that server process has a fixed PROCESS NAME for each isntanc=
e, and if there is already a running process with that name,=20
the attempt to start the process would get an error 12. Look at =
the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and=20
check what is in the "PROCESS". If it's present, there will eith=
er be one process name, or a list in paraentheses.=20
From a TACL prompt, issue a status command for each process in t=
he list.=20
=20
Bill=20
Bill,=20
=20
Very good remembering that filesystem error 12 is used for attempt=
ing to start a process with a name that already exists. I should have remem=
bered that myself. Unless Pathway's link management also uses filesystem er=
ror 12 for other problems, I'd say a duplicate process name is likely to be=
the explanation for this problem. Perhaps Uros has set up a test environme=
nt by duplicating the configuration of an existing environment and did not =
know to change the configured fixed server process names.=20
Hi,=20
=20
Thank you all for your help.=20
=20
I changed the code:=20
1) I added SERVERCLASS_SEND_INFO output error number to see if comma=
nd was succsesfully processed.=20
2) I changed the buffer to a 200-byte array.=20
3) I find some tal example of a similar program and I noticed that t=
his tal program, sends the command to a different pathway server. I send it=
to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal =
program sends the command to the server SERVER-NCP, which sees all "node" s=
ervers.=20
=20
It is interesting because if I send a command to SERVER-NCP I get a =
different error code.=20
SERVER-NCP:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =
=3D 21=20
=20
SERVER-NCP-1A:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =
=3D 12=20
=20
I think that the correct server is a SERVER-NCP.=20
=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
=20
Pahway server configuration:=20
MAXLINKMONS 20 [CURRENTLY 2]=20
=20
SERVER SERVER-NCPI-1A=20
LINKDEPTH 1=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1AU (ASSOCIATIVE ON)=20
=20
SERVER SERVER-NCP=20
LINKDEPTH 32=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1C1=20
PROCESS $D1C2=20
PROCESS $D1C3=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
=20
code:=20
#include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <tal.h>=20
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> noli=
st=20
main()=20
{=20
short error, error2, pserror, fserror,countread;=20
char *pmon;=20
char buffer [200]=3D{0};=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCP";=20
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf("\nSERVERCLASS_SEND_INFO error =3D %d \nSERVERCLASS_SEND_ er=
ror =3D %d, pathsend error =3D %d, fs error =3D %d\n",error2, error, pserro=
r, fserror);=20
printf("\nBuffer size =3D %d\n", strlen(buffer));=20
=20
int i;=20
for(i=3D0; i<strlen(buffer); i++)=20
{=20
printf("%c",buffer[i]);=20
}=20
printf("\n\n\n");=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
I see the original server was setup with 'Asoociative On' It's possib=
le the open table in the server can't accept another open.=20
=20
Can't explain the error 21.=20
I would try changing PMON and SNAME from pointers to arrays and see if =
it doesn't help with the error 21.=20
char pmon[] =3D "$D1MN";
char sname[] =3D "SERVER-NCP";=20
=20
Dave
Hi,=20
=20
Keith, I don't find anything in the manuals, that would show me what to s=
end to the server.=20
=20
I did not post the complete output to make this thread readable as possib=
le. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data type=
s, also arrays instead of pointers. The result is the same. I'm almost sure=
that I need to send command to the SERVER-NCP server instead the SERVER-NC=
PI-1A.=20
=20
Currently I'm using arrays:=20
=20
char pmon[5]=3D{0};
char buffer [200]=3D{0};
char sname[20]=3D{0};=20
=20
strcpy(pmon,"$D1MN");=20
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */
OUTPUT:=20
SERVERCLASS_SEND_INFO error =3D 0
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =3D 21
Buffer size =3D 26=20
STATUS PROCESS P1A^BICUNI1=20
=20
=20
EMS messages:=20
=20
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116=20
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,=20
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP=20
=20
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6=20
DEV1VHS:=20
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR=20
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received=20
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.=20
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.=20
=20
I'm losing ideas what else to try.=20
=20
Uros
I just notice another EMS error in collector $0
21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
Uros
Are you sure that server accepts a command line text buffer as input ?
Maybe it requires a structured message.



=status SERVER-NCPI-1A
SERVER-NCPI-1A 1

PROCESS STATE ERROR INFO #LINKS WEIGHT
$S1AU RUNNING 1 3

10> wake /highpin off/ $s1au
WRITE error 21 on $S1AU

11> wake /highpin off/ $s1au send STATUS
WRITE error 21 on $S1AU
uros kusar
2021-06-03 13:04:13 UTC
Permalink
Post by JShepherd
On Monday, May 31, 2021 at 3:59:31 PM UTC-4, Bill Honaker wrote:=20
com> wrote:=20
=20
sala:=20
On Friday, May 28, 2021 at 12:49:03 PM UTC-7, Bill Honaker wrote:=
=20
mail.com> wrote:=20
=20
Hi,=20
I'm writing C program that would get the status of the xpnet ob=
jects (stations,processes,node...). I'm using procedures described in the H=
P manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide.=
..) but I can't get anyting from Pathway except errors. Can you tell me wha=
t am I doing wrong?=20
=20
This is the code that I'm working on:=20
---------------------------------------------------------------=
-------------------------------------------------=20
include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)>=
nolist=20
#include <tal.h>=20
=20
main()=20
{=20
short error, error2,pserror, fserror,countread;=20
char *pmon;=20
char *buffer;=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCPI-1A";=20
buffer =3D"STATUS PROCESS P1A^BICUNI1";=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short) strlen(pmon), /* pathmon */=20
sname,=20
(short) strlen(sname), /* server class */=20
buffer,=20
(short) strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf ("\nSERVERCLASS_SEND_ error =3D %d, pathsend error =3D =
%d, fs error =3D %d\n", error, pserror, fserror);=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
---------------------------------------------------------------=
-------------------------------------------------=20
Response:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs err=
or =3D 12=20
=20
Best Regards,=20
Uros=20
Uros,=20
=20
Keith and Randall gave very valuable responses.=20
=20
Also one other possibility is that, in creating the link, the PA=
THMON tried to start a server process.=20
If that server process has a fixed PROCESS NAME for each isntanc=
e, and if there is already a running process with that name,=20
the attempt to start the process would get an error 12. Look at =
the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and=20
check what is in the "PROCESS". If it's present, there will eith=
er be one process name, or a list in paraentheses.=20
From a TACL prompt, issue a status command for each process in t=
he list.=20
=20
Bill=20
Bill,=20
=20
Very good remembering that filesystem error 12 is used for attempt=
ing to start a process with a name that already exists. I should have remem=
bered that myself. Unless Pathway's link management also uses filesystem er=
ror 12 for other problems, I'd say a duplicate process name is likely to be=
the explanation for this problem. Perhaps Uros has set up a test environme=
nt by duplicating the configuration of an existing environment and did not =
know to change the configured fixed server process names.=20
Hi,=20
=20
Thank you all for your help.=20
=20
I changed the code:=20
1) I added SERVERCLASS_SEND_INFO output error number to see if comma=
nd was succsesfully processed.=20
2) I changed the buffer to a 200-byte array.=20
3) I find some tal example of a similar program and I noticed that t=
his tal program, sends the command to a different pathway server. I send it=
to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal =
program sends the command to the server SERVER-NCP, which sees all "node" s=
ervers.=20
=20
It is interesting because if I send a command to SERVER-NCP I get a =
different error code.=20
SERVER-NCP:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =
=3D 21=20
=20
SERVER-NCP-1A:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =
=3D 12=20
=20
I think that the correct server is a SERVER-NCP.=20
=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
=20
Pahway server configuration:=20
MAXLINKMONS 20 [CURRENTLY 2]=20
=20
SERVER SERVER-NCPI-1A=20
LINKDEPTH 1=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1AU (ASSOCIATIVE ON)=20
=20
SERVER SERVER-NCP=20
LINKDEPTH 32=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1C1=20
PROCESS $D1C2=20
PROCESS $D1C3=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
=20
code:=20
#include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <tal.h>=20
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> noli=
st=20
main()=20
{=20
short error, error2, pserror, fserror,countread;=20
char *pmon;=20
char buffer [200]=3D{0};=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCP";=20
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf("\nSERVERCLASS_SEND_INFO error =3D %d \nSERVERCLASS_SEND_ er=
ror =3D %d, pathsend error =3D %d, fs error =3D %d\n",error2, error, pserro=
r, fserror);=20
printf("\nBuffer size =3D %d\n", strlen(buffer));=20
=20
int i;=20
for(i=3D0; i<strlen(buffer); i++)=20
{=20
printf("%c",buffer[i]);=20
}=20
printf("\n\n\n");=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
I see the original server was setup with 'Asoociative On' It's possib=
le the open table in the server can't accept another open.=20
=20
Can't explain the error 21.=20
I would try changing PMON and SNAME from pointers to arrays and see if =
it doesn't help with the error 21.=20
char pmon[] =3D "$D1MN";
char sname[] =3D "SERVER-NCP";=20
=20
Dave
Hi,=20
=20
Keith, I don't find anything in the manuals, that would show me what to s=
end to the server.=20
=20
I did not post the complete output to make this thread readable as possib=
le. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data type=
s, also arrays instead of pointers. The result is the same. I'm almost sure=
that I need to send command to the SERVER-NCP server instead the SERVER-NC=
PI-1A.=20
=20
Currently I'm using arrays:=20
=20
char pmon[5]=3D{0};
char buffer [200]=3D{0};
char sname[20]=3D{0};=20
=20
strcpy(pmon,"$D1MN");=20
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */
OUTPUT:=20
SERVERCLASS_SEND_INFO error =3D 0
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =3D 21
Buffer size =3D 26=20
STATUS PROCESS P1A^BICUNI1=20
=20
=20
EMS messages:=20
=20
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116=20
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,=20
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP=20
=20
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6=20
DEV1VHS:=20
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR=20
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received=20
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.=20
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.=20
=20
I'm losing ideas what else to try.=20
=20
Uros
I just notice another EMS error in collector $0
21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
Uros
Are you sure that server accepts a command line text buffer as input ?
Maybe it requires a structured message.
=status SERVER-NCPI-1A
SERVER-NCPI-1A 1
PROCESS STATE ERROR INFO #LINKS WEIGHT
$S1AU RUNNING 1 3
10> wake /highpin off/ $s1au
WRITE error 21 on $S1AU
11> wake /highpin off/ $s1au send STATUS
WRITE error 21 on $S1AU
Hi,

I'm still trying to understand why my code doesn't work. I think that something is wrong with the structures.

This tal program was written by my coworker.

?symbols !NCPSTASTAT
?inspect !NCPSTASTAT
!NCPSTASTAT
?nolist, source $system.system.extdecs0( !NCPSTASTAT
? close, !NCPSTASTAT
? initializer, !NCPSTASTAT
? myterm, !NCPSTASTAT
? numout, !NCPSTASTAT
? open, !NCPSTASTAT
? time, !NCPSTASTAT
? serverclass_send_, !NCPSTASTAT
? serverclass_send_info_, !NCPSTASTAT
? shiftstring, !NCPSTASTAT
? write ) !NCPSTASTAT
!NCPSTASTAT
?nolist, source $data02.aciutils.sysmsgs( !NCPSTASTAT
? ci^startup ) !NCPSTASTAT
!NCPSTASTAT
?nolist, source $data02.ba60src.bancptal( !NCPSTASTAT
? attributes, !NCPSTASTAT
? constants, !NCPSTASTAT
? defs, !NCPSTASTAT
? ncp^lex^struct, !NCPSTASTAT
? errors^and^warnings, !NCPSTASTAT
? requests, !NCPSTASTAT
? responses, !NCPSTASTAT
? structs, !NCPSTASTAT
? token ) !NCPSTASTAT
!NCPSTASTAT
!NCPSTASTAT
! globals !!NCPSTASTAT
string .pmon^nam^g[0:14] := [$occurs( pmon^nam^g ) * [" "]], !NCPSTASTAT
.sta^nam^g[0:15] := [$occurs( sta^nam^g ) * [" "]]; !NCPSTASTAT
!NCPSTASTAT
!NCPSTASTAT
proc startupproc( rucb, passthru, !NCPSTASTAT
startupbuf, startup^len, !NCPSTASTAT
match ) variable; !NCPSTASTAT
int .rucb, !NCPSTASTAT
.passthru, !NCPSTASTAT
.startupbuf, !NCPSTASTAT
startup^len, !NCPSTASTAT
match; !NCPSTASTAT
!NCPSTASTAT
begin !NCPSTASTAT
!NCPSTASTAT
int .startups( ci^startup ) := @startupbuf; !NCPSTASTAT
!NCPSTASTAT
string .start^list[0:23] := [$occurs( start^list ) * [" "]], !NCPSTASTAT
.sptr, !NCPSTASTAT
.eptr; !NCPSTASTAT
!NCPSTASTAT
!NCPSTASTAT
! !!NCPSTASTAT
! Get argument parameters !!NCPSTASTAT
! !!NCPSTASTAT
if not startups.parm then !NCPSTASTAT
begin !NCPSTASTAT
! no arguments provided !!NCPSTASTAT
end !NCPSTASTAT
else !NCPSTASTAT
begin !NCPSTASTAT
! arguments provided, parse them !!NCPSTASTAT
start^list ':=' startups.parm for 12 words; !NCPSTASTAT
! all uppercase !!NCPSTASTAT
call shiftstring( start^list, $occurs( start^list ), 0 ); !NCPSTASTAT
!NCPSTASTAT
scan start^list until " " -> @sptr; !NCPSTASTAT
if not $carry then !NCPSTASTAT
begin !NCPSTASTAT
pmon^nam^g ':=' start^list for ( @sptr - @start^list ); !NCPSTASTAT
!NCPSTASTAT
scan sptr[1] until %h00 -> @eptr; !NCPSTASTAT
sta^nam^g ':=' sptr[1] for ( @eptr - @sptr[1] ); !NCPSTASTAT
end; !NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
proc ncp^sta^stat main; !NCPSTASTAT
begin !NCPSTASTAT
!NCPSTASTAT
struct .ncp^rqst( ncp^lex^struct^def ); !NCPSTASTAT
!NCPSTASTAT
int .cnt^read := 0, !NCPSTASTAT
err := 0, !NCPSTASTAT
file^err := 0, !NCPSTASTAT
term^num := -1, !NCPSTASTAT
.ncp^resp( ncp^resp^struct^def ), !NCPSTASTAT
.ncp^resp^tkn( var^token^def ), !NCPSTASTAT
.ncp^resp^stat( ncp^resp^status^sta^def ), !NCPSTASTAT
.tim^array[0:6], !NCPSTASTAT
.term^name[0:11], !NCPSTASTAT
.buff[0:39]; !NCPSTASTAT
!NCPSTASTAT
string .srv^class[0:14] := ["SERVER-NCP "], !NCPSTASTAT
.cur^state[0:8], !NCPSTASTAT
.log^state[0:8], !NCPSTASTAT
.q^cnt[0:4], !NCPSTASTAT
.err^s[0:4], !NCPSTASTAT
.file^err^s[0:4]; !NCPSTASTAT
!NCPSTASTAT
!NCPSTASTAT
call initializer( ! rucb ! , !NCPSTASTAT
!passthru ! , !NCPSTASTAT
startupproc , !NCPSTASTAT
!paramproc ! , !NCPSTASTAT
!assignproc ! , !NCPSTASTAT
!flags! ); !NCPSTASTAT
!NCPSTASTAT
call myterm( term^name ); !NCPSTASTAT
! open hometerm !!NCPSTASTAT
call open( term^name, term^num ); !NCPSTASTAT
if <> then !NCPSTASTAT
begin !NCPSTASTAT
return; !NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
! check if startup arguments were provided !!NCPSTASTAT
if pmon^nam^g = " " or !NCPSTASTAT
sta^nam^g = " " then !NCPSTASTAT
begin !NCPSTASTAT
buff ':=' "Provide PATHWAY PPD and STATION NAME arguments!"; !NCPSTASTAT
call write( term^num, buff, 47 ); !NCPSTASTAT
!NCPSTASTAT
call close( term^num ); !NCPSTASTAT
return; !NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.cmd := ncp^cmd^status; ! STATUS command !!NCPSTASTAT
ncp^rqst.static.obj^typ := ncp^obj^process; ! for STATIONS !!NCPSTASTAT
ncp^rqst.static.obj ':=' sta^nam^g for $occurs( sta^nam^g ); !NCPSTASTAT
ncp^rqst.static.rn ':=' [" "] & !NCPSTASTAT
ncp^rqst.static.rn for !NCPSTASTAT
$len( ncp^rqst.static.rn ) - 1; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.end^user^id.user ':=' ! USERNAME !!NCPSTASTAT
[" "] & !NCPSTASTAT
ncp^rqst.static.end^user^id.user for !NCPSTASTAT
$len( ncp^rqst.static.end^user^id.user ) - 1; !NCPSTASTAT
ncp^rqst.static.user^info ':=' ! PASSWORD !!NCPSTASTAT
[" "] & !NCPSTASTAT
ncp^rqst.static.user^info for !NCPSTASTAT
$len( ncp^rqst.static.user^info ) - 1; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.end^user^id.sess^id ':=' !NCPSTASTAT
[" "] & !NCPSTASTAT
ncp^rqst.static.end^user^id.sess^id for !NCPSTASTAT
$len( ncp^rqst.static.end^user^id.sess^id ) - 1; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.cmd^timout := 1000d; !NCPSTASTAT
!NCPSTASTAT
call time( tim^array ); !NCPSTASTAT
! insert timestamp in NCP request structure !!NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[0], !NCPSTASTAT
tim^array[0], 10, 2 ); !NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[2], !NCPSTASTAT
tim^array[1], 10, 2 ); !NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[4], !NCPSTASTAT
tim^array[2], 10, 2 ); !NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[6], !NCPSTASTAT
tim^array[3], 10, 2 ); !NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[8], !NCPSTASTAT
tim^array[4], 10, 2 ); !NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[10], !NCPSTASTAT
tim^array[5], 10, 2 ); !NCPSTASTAT
call numout( ncp^rqst.static.tstamp.byte[12], !NCPSTASTAT
tim^array[6], 10, 2 ); !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.max^resps := ncp^val^max^resps^fill; !NCPSTASTAT
ncp^rqst.static.rqst^vsn ':=' ncp^val^version^300; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.ctx^info ':=' !NCPSTASTAT
[" "] & !NCPSTASTAT
ncp^rqst.static.ctx^info for !NCPSTASTAT
$len( ncp^rqst.static.ctx^info ) - 1; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.static.resp^typ := ncp^val^resp^err^warn^norm; !NCPSTASTAT
ncp^rqst.static.rqst^cntl := ncp^val^rqst^err^warn^norm; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.dynamic^var1 ':=' !NCPSTASTAT
[%h00] & !NCPSTASTAT
ncp^rqst.dynamic^var1 for !NCPSTASTAT
$len( ncp^rqst.dynamic^var1 ) - 1; !NCPSTASTAT
!NCPSTASTAT
ncp^rqst.dynamic^area^lgth := $len( ncp^rqst.dynamic^area^lgth ); !NCPSTASTAT
! calculate NCP request length !!NCPSTASTAT
ncp^rqst.static.lgth := !NCPSTASTAT
$len( ncp^rqst.static ) + !NCPSTASTAT
$len( ncp^rqst.dynamic^area^lgth ) + !NCPSTASTAT
ncp^rqst.dynamic^area^lgth; !NCPSTASTAT
!NCPSTASTAT
! PATHSEND to SERVER-NCP !!NCPSTASTAT
err := serverclass_send_( pmon^nam^g, !NCPSTASTAT
$occurs( pmon^nam^g ), !NCPSTASTAT
srv^class, !NCPSTASTAT
$occurs( srv^class ), !NCPSTASTAT
ncp^rqst, !NCPSTASTAT
$len( ncp^rqst ), !NCPSTASTAT
$len( ncp^resp^struct^def ), !NCPSTASTAT
cnt^read ); !NCPSTASTAT
!NCPSTASTAT
if not err then !NCPSTASTAT
begin !NCPSTASTAT
@ncp^resp^tkn := @ncp^rqst.dynamic^var1.dynamic^area; !NCPSTASTAT
@ncp^resp := @ncp^resp^tkn.var^data; !NCPSTASTAT
if ncp^resp.resp^code <> ncp^err^ok then !NCPSTASTAT
begin !NCPSTASTAT
! server NCP returned error !!NCPSTASTAT
end !NCPSTASTAT
else !NCPSTASTAT
begin !NCPSTASTAT
if ncp^rqst.static.max^resps >= 1 then !NCPSTASTAT
begin !NCPSTASTAT
! print field info !!NCPSTASTAT
buff ':=' " CURRENT LOGICAL"; !NCPSTASTAT
call write( term^num, buff, 36 ); !NCPSTASTAT
buff ':=' "STATION STATE STATE " & !NCPSTASTAT
" QUEUE COUNT"; !NCPSTASTAT
call write( term^num, buff, 50 ); !NCPSTASTAT
buff ':=' "---------------- ------- -------" & !NCPSTASTAT
" -----------"; !NCPSTASTAT
call write( term^num, buff, 50 ); !NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
! loop parse response STATION data and show the STATES !!NCPSTASTAT
use x; x := 0; !NCPSTASTAT
while x < ncp^rqst.static.max^resps do !NCPSTASTAT
begin !NCPSTASTAT
@ncp^resp^stat := @ncp^resp.resp^data[16]; !NCPSTASTAT
!NCPSTASTAT
! check current state !!NCPSTASTAT
case ncp^resp^stat.current^state of !NCPSTASTAT
begin !NCPSTASTAT
ncp^val^abnormal -> cur^state ':=' "ABNORMAL "; !NCPSTASTAT
ncp^val^started -> cur^state ':=' "STARTED "; !NCPSTASTAT
ncp^val^starting -> cur^state ':=' "STARTING "; !NCPSTASTAT
ncp^val^stopped -> cur^state ':=' "STOPPED "; !NCPSTASTAT
ncp^val^stopping -> cur^state ':=' "STOPPING "; !NCPSTASTAT
ncp^val^suspended -> cur^state ':=' "SUSPENDED"; !NCPSTASTAT
otherwise -> cur^state ':=' "UNKNOWN "; !NCPSTASTAT
end; !NCPSTASTAT
! check logical state !!NCPSTASTAT
case ncp^resp^stat.logical^state of !NCPSTASTAT
begin !NCPSTASTAT
ncp^val^abnormal -> log^state ':=' "ABNORMAL "; !NCPSTASTAT
ncp^val^started -> log^state ':=' "STARTED "; !NCPSTASTAT
ncp^val^starting -> log^state ':=' "STARTING "; !NCPSTASTAT
ncp^val^stopped -> log^state ':=' "STOPPED "; !NCPSTASTAT
ncp^val^stopping -> log^state ':=' "STOPPING "; !NCPSTASTAT
ncp^val^suspended -> log^state ':=' "SUSPENDED"; !NCPSTASTAT
otherwise -> log^state ':=' "UNKNOWN "; !NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
! convert queue count to ascii !!NCPSTASTAT
call numout( q^cnt, ncp^resp^stat.queue^count, !NCPSTASTAT
10, $occurs( q^cnt ) ); !NCPSTASTAT
!NCPSTASTAT
buff ':=' ncp^resp.resp^obj for !NCPSTASTAT
$len( ncp^resp.resp^obj ) & " " & !NCPSTASTAT
cur^state for $occurs( cur^state ) & " " & !NCPSTASTAT
log^state for $occurs( log^state ) & !NCPSTASTAT
" " & !NCPSTASTAT
q^cnt for $occurs( q^cnt ); !NCPSTASTAT
call write( term^num, buff, 53 ); !NCPSTASTAT
!NCPSTASTAT
! position on next STATION data !!NCPSTASTAT
if ncp^rqst.static.max^resps > 1 then !NCPSTASTAT
@ncp^resp := @ncp^resp.resp^data[28]; !NCPSTASTAT
!NCPSTASTAT
! increment counter !!NCPSTASTAT
x := x + 1; !NCPSTASTAT
end; !NCPSTASTAT
drop x; !NCPSTASTAT
end; !NCPSTASTAT
end !NCPSTASTAT
else !NCPSTASTAT
if err = 233 then !NCPSTASTAT
begin !NCPSTASTAT
! PATHSEND error, get error details !!NCPSTASTAT
call serverclass_send_info_( err, file^err ); !NCPSTASTAT
!NCPSTASTAT
! convert errors to ascii !!NCPSTASTAT
call numout( err^s, err, 10, $occurs( err^s ) ); !NCPSTASTAT
call numout( file^err^s, file^err, 10, $occurs( file^err^s ) );!NCPSTASTAT
!NCPSTASTAT
buff ':=' "PATHSEND error: " & err^s for $occurs( err^s ) & !NCPSTASTAT
", file error: " & file^err^s for $occurs( file^err^s ); !NCPSTASTAT
call write( term^num, buff, 40 ); !NCPSTASTAT
end !NCPSTASTAT
else !NCPSTASTAT
begin !NCPSTASTAT
! <> 233, unknown pathsend error !!NCPSTASTAT
end; !NCPSTASTAT
!NCPSTASTAT
! close hometerm !!NCPSTASTAT
call close( term^num ); !NCPSTASTAT
!NCPSTASTAT
end; !NCPSTASTAT


Uros
JShepherd
2021-06-03 14:59:16 UTC
Permalink
Post by JShepherd
On Monday, May 31, 2021 at 3:59:31 PM UTC-4, Bill Honaker wrote:=20
On Mon, 31 May 2021 04:07:05 -0700 (PDT), uros kusar
com> wrote:=20
=20
sala:=20
On Friday, May 28, 2021 at 12:49:03 PM UTC-7, Bill Honaker wrote:=
=20
mail.com> wrote:=20
=20
Hi,=20
I'm writing C program that would get the status of the xpnet ob=
jects (stations,processes,node...). I'm using procedures described in the H=
P manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide.=
..) but I can't get anyting from Pathway except errors. Can you tell me wha=
t am I doing wrong?=20
=20
This is the code that I'm working on:=20
---------------------------------------------------------------=
Post by JShepherd
-------------------------------------------------=20
include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <cextdecs (SERVERCLASS_SEND_,
SERVERCLASS_SEND_INFO_)>=
Post by JShepherd
nolist=20
#include <tal.h>=20
=20
main()=20
{=20
short error, error2,pserror, fserror,countread;=20
char *pmon;=20
char *buffer;=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCPI-1A";=20
buffer =3D"STATUS PROCESS P1A^BICUNI1";=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short) strlen(pmon), /* pathmon */=20
sname,=20
(short) strlen(sname), /* server class */=20
buffer,=20
(short) strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf ("\nSERVERCLASS_SEND_ error =3D %d, pathsend error =3D =
%d, fs error =3D %d\n", error, pserror, fserror);=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
---------------------------------------------------------------=
Post by JShepherd
-------------------------------------------------=20
Response:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs err=
or =3D 12=20
=20
Best Regards,=20
Uros=20
Uros,=20
=20
Keith and Randall gave very valuable responses.=20
=20
Also one other possibility is that, in creating the link, the PA=
THMON tried to start a server process.=20
If that server process has a fixed PROCESS NAME for each isntanc=
e, and if there is already a running process with that name,=20
the attempt to start the process would get an error 12. Look at =
the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and=20
check what is in the "PROCESS". If it's present, there will eith=
er be one process name, or a list in paraentheses.=20
From a TACL prompt, issue a status command for each process in t=
he list.=20
=20
Bill=20
Bill,=20
=20
Very good remembering that filesystem error 12 is used for attempt=
ing to start a process with a name that already exists. I should have remem=
bered that myself. Unless Pathway's link management also uses filesystem er=
ror 12 for other problems, I'd say a duplicate process name is likely to be=
the explanation for this problem. Perhaps Uros has set up a test environme=
nt by duplicating the configuration of an existing environment and did not =
know to change the configured fixed server process names.=20
Hi,=20
=20
Thank you all for your help.=20
=20
I changed the code:=20
1) I added SERVERCLASS_SEND_INFO output error number to see if comma=
nd was succsesfully processed.=20
2) I changed the buffer to a 200-byte array.=20
3) I find some tal example of a similar program and I noticed that t=
his tal program, sends the command to a different pathway server. I send it=
to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the tal =
program sends the command to the server SERVER-NCP, which sees all "node" s=
ervers.=20
=20
It is interesting because if I send a command to SERVER-NCP I get a =
different error code.=20
SERVER-NCP:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =
=3D 21=20
=20
SERVER-NCP-1A:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =
=3D 12=20
=20
I think that the correct server is a SERVER-NCP.=20
=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
Post by JShepherd
=20
Pahway server configuration:=20
MAXLINKMONS 20 [CURRENTLY 2]=20
=20
SERVER SERVER-NCPI-1A=20
LINKDEPTH 1=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1AU (ASSOCIATIVE ON)=20
=20
SERVER SERVER-NCP=20
LINKDEPTH 32=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1C1=20
PROCESS $D1C2=20
PROCESS $D1C3=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
Post by JShepherd
=20
code:=20
#include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <tal.h>=20
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)> noli=
st=20
main()=20
{=20
short error, error2, pserror, fserror,countread;=20
char *pmon;=20
char buffer [200]=3D{0};=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCP";=20
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf("\nSERVERCLASS_SEND_INFO error =3D %d \nSERVERCLASS_SEND_ er=
ror =3D %d, pathsend error =3D %d, fs error =3D %d\n",error2, error, pserro=
r, fserror);=20
printf("\nBuffer size =3D %d\n", strlen(buffer));=20
=20
int i;=20
for(i=3D0; i<strlen(buffer); i++)=20
{=20
printf("%c",buffer[i]);=20
}=20
printf("\n\n\n");=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
I see the original server was setup with 'Asoociative On' It's possib=
le the open table in the server can't accept another open.=20
=20
Can't explain the error 21.=20
I would try changing PMON and SNAME from pointers to arrays and see if =
it doesn't help with the error 21.=20
char pmon[] =3D "$D1MN";
char sname[] =3D "SERVER-NCP";=20
=20
Dave
Hi,=20
=20
Keith, I don't find anything in the manuals, that would show me what to s=
end to the server.=20
=20
I did not post the complete output to make this thread readable as possib=
le. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data type=
s, also arrays instead of pointers. The result is the same. I'm almost sure=
that I need to send command to the SERVER-NCP server instead the SERVER-NC=
PI-1A.=20
=20
Currently I'm using arrays:=20
=20
char pmon[5]=3D{0};
char buffer [200]=3D{0};
char sname[20]=3D{0};=20
=20
strcpy(pmon,"$D1MN");=20
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */
OUTPUT:=20
SERVERCLASS_SEND_INFO error =3D 0
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =3D 21
Buffer size =3D 26=20
STATUS PROCESS P1A^BICUNI1=20
=20
=20
EMS messages:=20
=20
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116=20
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,=20
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP=20
=20
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6=20
DEV1VHS:=20
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR=20
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received=20
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.=20
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.=20
=20
I'm losing ideas what else to try.=20
=20
Uros
I just notice another EMS error in collector $0
21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
Uros
Are you sure that server accepts a command line text buffer as input ?
Maybe it requires a structured message.
=status SERVER-NCPI-1A
SERVER-NCPI-1A 1
PROCESS STATE ERROR INFO #LINKS WEIGHT
$S1AU RUNNING 1 3
10> wake /highpin off/ $s1au
WRITE error 21 on $S1AU
11> wake /highpin off/ $s1au send STATUS
WRITE error 21 on $S1AU
Hi,
I'm still trying to understand why my code doesn't work. I think that
something
is wrong with the structures.
This tal program was written by my coworker.
Uros
From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );

Then handle the potentially multi-item response coming back

int .ncp^resp( ncp^resp^struct^def ),


You will need C versions of all those TAL structs or
do it in TAL
Keith Dick
2021-06-03 15:51:49 UTC
Permalink
Post by JShepherd
On Monday, May 31, 2021 at 3:59:31 PM UTC-4, Bill Honaker wrote:=20
On Mon, 31 May 2021 04:07:05 -0700 (PDT), uros kusar
com> wrote:=20
=20
napi=
Post by JShepherd
sala:=20
On Friday, May 28, 2021 at 12:49:03 PM UTC-7, Bill Honaker
wrote:=
Post by JShepherd
=20
On Fri, 28 May 2021 00:06:17 -0700 (PDT), uros kusar
mail.com> wrote:=20
=20
Hi,=20
I'm writing C program that would get the status of the xpnet
ob=
Post by JShepherd
jects (stations,processes,node...). I'm using procedures described in the
H=
Post by JShepherd
P manuals(Pathsend and Server programming Manual, C/C++ programmer's
Guide.=
Post by JShepherd
..) but I can't get anyting from Pathway except errors. Can you tell me
wha=
Post by JShepherd
t am I doing wrong?=20
=20
This is the code that I'm working on:=20
---------------------------------------------------------------=
Post by JShepherd
-------------------------------------------------=20
include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <cextdecs (SERVERCLASS_SEND_,
SERVERCLASS_SEND_INFO_)>=
Post by JShepherd
nolist=20
#include <tal.h>=20
=20
main()=20
{=20
short error, error2,pserror, fserror,countread;=20
char *pmon;=20
char *buffer;=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCPI-1A";=20
buffer =3D"STATUS PROCESS P1A^BICUNI1";=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short) strlen(pmon), /* pathmon */=20
sname,=20
(short) strlen(sname), /* server class */=20
buffer,=20
(short) strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf ("\nSERVERCLASS_SEND_ error =3D %d, pathsend error
=3D =
Post by JShepherd
%d, fs error =3D %d\n", error, pserror, fserror);=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
---------------------------------------------------------------=
Post by JShepherd
-------------------------------------------------=20
Response:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs
err=
Post by JShepherd
or =3D 12=20
=20
Best Regards,=20
Uros=20
Uros,=20
=20
Keith and Randall gave very valuable responses.=20
=20
Also one other possibility is that, in creating the link, the
PA=
Post by JShepherd
THMON tried to start a server process.=20
If that server process has a fixed PROCESS NAME for each
isntanc=
Post by JShepherd
e, and if there is already a running process with that name,=20
the attempt to start the process would get an error 12. Look
at =
Post by JShepherd
the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and=20
check what is in the "PROCESS". If it's present, there will
eith=
Post by JShepherd
er be one process name, or a list in paraentheses.=20
From a TACL prompt, issue a status command for each process in
t=
Post by JShepherd
he list.=20
=20
Bill=20
Bill,=20
=20
Very good remembering that filesystem error 12 is used for
attempt=
Post by JShepherd
ing to start a process with a name that already exists. I should have
remem=
Post by JShepherd
bered that myself. Unless Pathway's link management also uses filesystem
er=
Post by JShepherd
ror 12 for other problems, I'd say a duplicate process name is likely to
be=
Post by JShepherd
the explanation for this problem. Perhaps Uros has set up a test
environme=
Post by JShepherd
nt by duplicating the configuration of an existing environment and did
not =
Post by JShepherd
know to change the configured fixed server process names.=20
Hi,=20
=20
Thank you all for your help.=20
=20
I changed the code:=20
1) I added SERVERCLASS_SEND_INFO output error number to see if
comma=
Post by JShepherd
nd was succsesfully processed.=20
2) I changed the buffer to a 200-byte array.=20
3) I find some tal example of a similar program and I noticed that
t=
Post by JShepherd
his tal program, sends the command to a different pathway server. I send
it=
Post by JShepherd
to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the
tal =
Post by JShepherd
program sends the command to the server SERVER-NCP, which sees all "node"
s=
Post by JShepherd
ervers.=20
=20
It is interesting because if I send a command to SERVER-NCP I get
a =
Post by JShepherd
different error code.=20
SERVER-NCP:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error
=
Post by JShepherd
=3D 21=20
=20
SERVER-NCP-1A:=20
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error
=
Post by JShepherd
=3D 12=20
=20
I think that the correct server is a SERVER-NCP.=20
=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
Post by JShepherd
=20
Pahway server configuration:=20
MAXLINKMONS 20 [CURRENTLY 2]=20
=20
SERVER SERVER-NCPI-1A=20
LINKDEPTH 1=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1AU (ASSOCIATIVE ON)=20
=20
SERVER SERVER-NCP=20
LINKDEPTH 32=20
MAXLINKS 32=20
MAXSERVERS 3=20
PROCESS $D1C1=20
PROCESS $D1C2=20
PROCESS $D1C3=20
--------------------------------------------------------------------=
-------------------------------------------------------------------------=
Post by JShepherd
=20
code:=20
#include <stdlib.h>=20
#include <stdio.h>=20
#include <string.h>=20
#include <tal.h>=20
#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)>
noli=
Post by JShepherd
st=20
main()=20
{=20
short error, error2, pserror, fserror,countread;=20
char *pmon;=20
char buffer [200]=3D{0};=20
char *sname;=20
=20
pmon =3D"$D1MN";=20
sname =3D "SERVER-NCP";=20
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */=20
if (error !=3D 0)=20
{=20
error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
printf("\nSERVERCLASS_SEND_INFO error =3D %d \nSERVERCLASS_SEND_
er=
Post by JShepherd
ror =3D %d, pathsend error =3D %d, fs error =3D %d\n",error2, error,
pserro=
Post by JShepherd
r, fserror);=20
printf("\nBuffer size =3D %d\n", strlen(buffer));=20
=20
int i;=20
for(i=3D0; i<strlen(buffer); i++)=20
{=20
printf("%c",buffer[i]);=20
}=20
printf("\n\n\n");=20
exit (1);=20
}=20
else=20
{=20
buffer [countread] =3D 0;=20
printf ("\nReply =3D %s\n", buffer);=20
}=20
}=20
I see the original server was setup with 'Asoociative On' It's
possib=
Post by JShepherd
le the open table in the server can't accept another open.=20
=20
Can't explain the error 21.=20
I would try changing PMON and SNAME from pointers to arrays and see
if =
Post by JShepherd
it doesn't help with the error 21.=20
char pmon[] =3D "$D1MN";
char sname[] =3D "SERVER-NCP";=20
=20
Dave
Hi,=20
=20
Keith, I don't find anything in the manuals, that would show me what to
s=
Post by JShepherd
end to the server.=20
=20
I did not post the complete output to make this thread readable as
possib=
Post by JShepherd
le. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data
type=
Post by JShepherd
s, also arrays instead of pointers. The result is the same. I'm almost
sure=
Post by JShepherd
that I need to send command to the SERVER-NCP server instead the
SERVER-NC=
Post by JShepherd
PI-1A.=20
=20
Currently I'm using arrays:=20
=20
char pmon[5]=3D{0};
char buffer [200]=3D{0};
char sname[20]=3D{0};=20
=20
strcpy(pmon,"$D1MN");=20
strcpy(sname,"SERVER-NCP");
strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
=20
error =3D SERVERCLASS_SEND_ (pmon,=20
(short)strlen(pmon), /* pathmon */=20
sname,=20
(short)strlen(sname), /* server class */=20
buffer,=20
(short)strlen(buffer),=20
200,=20
&countread,=20
-1); /* timeout =3D forever */
OUTPUT:=20
SERVERCLASS_SEND_INFO error =3D 0
SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =3D
21
Post by JShepherd
Buffer size =3D 26=20
STATUS PROCESS P1A^BICUNI1=20
=20
=20
EMS messages:=20
=20
21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116=20
\PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,=20
ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP=20
=20
21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6=20
DEV1VHS:=20
02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR=20
DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received=20
from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.=20
Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.=20
=20
I'm losing ideas what else to try.=20
=20
Uros
I just notice another EMS error in collector $0
21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
operation ACS_FS_PSWRITEREAD_() failed, process
\PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
Uros
Are you sure that server accepts a command line text buffer as input ?
Maybe it requires a structured message.
=status SERVER-NCPI-1A
SERVER-NCPI-1A 1
PROCESS STATE ERROR INFO #LINKS WEIGHT
$S1AU RUNNING 1 3
10> wake /highpin off/ $s1au
WRITE error 21 on $S1AU
11> wake /highpin off/ $s1au send STATUS
WRITE error 21 on $S1AU
Hi,
I'm still trying to understand why my code doesn't work. I think that
something
is wrong with the structures.
This tal program was written by my coworker.
Uros
From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );
Then handle the potentially multi-item response coming back
int .ncp^resp( ncp^resp^struct^def ),
You will need C versions of all those TAL structs or
do it in TAL
As JShepherd notes, the TAL code indicates that the request and response messages are not simple text strings, but moderately complex structures. Your coworker had some instructions about how to construct and interpret those structures. If that coworker is still around, ask where he or she got the instructions. If he or she is not still around, you might find some documentation in a file in the subvolume $DATA02.ACIUTILS, or in some other location that contains files from ACI. If you are lucky, ACI provided some documentation and the structure declarations suitable for writing the program in C. If they supplied only help for TAL programmers, you will have a bit of a difficult time if you don't know TAL.
Bill Honaker
2021-06-03 17:00:07 UTC
Permalink
Post by Keith Dick
Post by JShepherd
From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );
Then handle the potentially multi-item response coming back
int .ncp^resp( ncp^resp^struct^def ),
You will need C versions of all those TAL structs or
do it in TAL
As JShepherd notes, the TAL code indicates that the request and response messages are not simple text strings, but moderately complex structures. Your coworker had some instructions about how to construct and interpret those structures. If that coworker is still around, ask where he or she got the instructions. If he or she is not still around, you might find some documentation in a file in the subvolume $DATA02.ACIUTILS, or in some other location that contains files from ACI. If you are lucky, ACI provided some documentation and the structure declarations suitable for writing the program in C. If they supplied only help for TAL programmers, you will have a bit of a difficult time if you don't know TAL.
That would explain the 'error 21'.

The server probably uses that error to indicate to the calling program that the message it received isn't correct for the structure (or structures) that it expects to receive.

The line that starts with "?nolist, source $data02.ba60src.bancptal(" implies that you should find a file called ?nolist, source $data02.ba60src.bancc that contains the
structures and literals required to build the message in C.

A very high level skim of the code also says you will need to parse the message and calculate pointers to some returned sub-structures, especially if they occur multiple times.

Bill
Randall
2021-06-03 18:52:45 UTC
Permalink
Post by Bill Honaker
Post by JShepherd
From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );
Then handle the potentially multi-item response coming back
int .ncp^resp( ncp^resp^struct^def ),
You will need C versions of all those TAL structs or
do it in TAL
As JShepherd notes, the TAL code indicates that the request and response messages are not simple text strings, but moderately complex structures. Your coworker had some instructions about how to construct and interpret those structures. If that coworker is still around, ask where he or she got the instructions. If he or she is not still around, you might find some documentation in a file in the subvolume $DATA02.ACIUTILS, or in some other location that contains files from ACI. If you are lucky, ACI provided some documentation and the structure declarations suitable for writing the program in C. If they supplied only help for TAL programmers, you will have a bit of a difficult time if you don't know TAL.
That would explain the 'error 21'.
The server probably uses that error to indicate to the calling program that the message it received isn't correct for the structure (or structures) that it expects to receive.
The line that starts with "?nolist, source $data02.ba60src.bancptal(" implies that you should find a file called ?nolist, source $data02.ba60src.bancc that contains the
structures and literals required to build the message in C.
A very high level skim of the code also says you will need to parse the message and calculate pointers to some returned sub-structures, especially if they occur multiple times.
Bill
Bill: I'm not sure what the specific server does, but the general IPC protocol for XPNet, particularly station-to-station messaging, is rather complex with optional fields controlled by bitmaps. I think the C coding error above may be part of the problem, though, before anything else happens. I do also think you're correct that the error 21 is coming from the server as a response to an invalid header, probably with a bad length field.
Bill Honaker
2021-06-03 19:43:12 UTC
Permalink
Post by Randall
Post by Bill Honaker
Post by JShepherd
From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );
Then handle the potentially multi-item response coming back
int .ncp^resp( ncp^resp^struct^def ),
You will need C versions of all those TAL structs or
do it in TAL
As JShepherd notes, the TAL code indicates that the request and response messages are not simple text strings, but moderately complex structures. Your coworker had some instructions about how to construct and interpret those structures. If that coworker is still around, ask where he or she got the instructions. If he or she is not still around, you might find some documentation in a file in the subvolume $DATA02.ACIUTILS, or in some other location that contains files from ACI. If you are lucky, ACI provided some documentation and the structure declarations suitable for writing the program in C. If they supplied only help for TAL programmers, you will have a bit of a difficult time if you don't know TAL.
That would explain the 'error 21'.
The server probably uses that error to indicate to the calling program that the message it received isn't correct for the structure (or structures) that it expects to receive.
The line that starts with "?nolist, source $data02.ba60src.bancptal(" implies that you should find a file called ?nolist, source $data02.ba60src.bancc that contains the
structures and literals required to build the message in C.
A very high level skim of the code also says you will need to parse the message and calculate pointers to some returned sub-structures, especially if they occur multiple times.
Bill
Bill: I'm not sure what the specific server does, but the general IPC protocol for XPNet, particularly station-to-station messaging, is rather complex with optional fields controlled by bitmaps. I think the C coding error above may be part of the problem, though, before anything else happens. I do also think you're correct that the error 21 is coming from the server as a response to an invalid header, probably with a bad length field.
For communications with devices, authorization services etc. XPNet uses ISO messages or X9.15 messages, both of which are character strings including bitmpas '
(1 or 2 for ISO, multi-level of X9.15). Command and Control internal messages use binary structures, often times concatenated based on context (such as number
of stations returned in a status station * command).

One should either review it with another staff member already familiar, attend an ACI course, or be prepared to dig deeply into the manuals.
Bill
uros kusar
2021-06-04 07:24:13 UTC
Permalink
Post by Bill Honaker
Post by Randall
Post by Bill Honaker
Post by JShepherd
From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );
Then handle the potentially multi-item response coming back
int .ncp^resp( ncp^resp^struct^def ),
You will need C versions of all those TAL structs or
do it in TAL
As JShepherd notes, the TAL code indicates that the request and response messages are not simple text strings, but moderately complex structures. Your coworker had some instructions about how to construct and interpret those structures. If that coworker is still around, ask where he or she got the instructions. If he or she is not still around, you might find some documentation in a file in the subvolume $DATA02.ACIUTILS, or in some other location that contains files from ACI. If you are lucky, ACI provided some documentation and the structure declarations suitable for writing the program in C. If they supplied only help for TAL programmers, you will have a bit of a difficult time if you don't know TAL.
That would explain the 'error 21'.
The server probably uses that error to indicate to the calling program that the message it received isn't correct for the structure (or structures) that it expects to receive.
The line that starts with "?nolist, source $data02.ba60src.bancptal(" implies that you should find a file called ?nolist, source $data02.ba60src.bancc that contains the
structures and literals required to build the message in C.
A very high level skim of the code also says you will need to parse the message and calculate pointers to some returned sub-structures, especially if they occur multiple times.
Bill
Bill: I'm not sure what the specific server does, but the general IPC protocol for XPNet, particularly station-to-station messaging, is rather complex with optional fields controlled by bitmaps. I think the C coding error above may be part of the problem, though, before anything else happens. I do also think you're correct that the error 21 is coming from the server as a response to an invalid header, probably with a bad length field.
For communications with devices, authorization services etc. XPNet uses ISO messages or X9.15 messages, both of which are character strings including bitmpas '
(1 or 2 for ISO, multi-level of X9.15). Command and Control internal messages use binary structures, often times concatenated based on context (such as number
of stations returned in a status station * command).
One should either review it with another staff member already familiar, attend an ACI course, or be prepared to dig deeply into the manuals.
Bill
Thank you all for your help. I will let you know when I found the request structures or make some progress on the program.

Regards,
Uros
gcav
2021-06-18 18:56:43 UTC
Permalink
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
AFAIK, to get status of stations,processes,node and all B24 things, you must talk directly to the XPNET process. You have to read the XPNET programmers guide.

gc
Gustavo Martinez
2021-07-28 20:54:51 UTC
Permalink
Post by gcav
Post by uros kusar
Hi,
I'm writing C program that would get the status of the xpnet objects (stations,processes,node...). I'm using procedures described in the HP manuals(Pathsend and Server programming Manual, C/C++ programmer's Guide...) but I can't get anyting from Pathway except errors. Can you tell me what am I doing wrong?
AFAIK, to get status of stations,processes,node and all B24 things, you must talk directly to the XPNET process. You have to read the XPNET programmers guide.
gc
Hello Uros,

You can write the "requester" against XPNET in C or TAL, that is not the problem. The correct server to be called is SERVER-NCP and you have to use SERVERCLASS_SEND_ as expected. The SERVER-NCP will determine which NCPI server the command needs to be send (if you send a message for only one NODE, then not all the the NCPI servers will be called).Effectively the structures are not so easy. You need to read carefully the manual in order to determine how to format the message and indicate to the NCP Server what you want to do. You would need basically three things to keep in mind:

1) The request contains a static part and a variable part. Being the static part easy and the variable part the complex one. One of the complex issues are how you indicate structures lenght. So I am guessing here that you are not sending correctly those structures and the SERVER-NCP respond with Filesystem error 21.

2) The request structure in C is: ncp_c_lex_struct_def

3) The variable part depends on the command you want to send to the NCP Server. If it is a DELIVER (for example), then look for the deliver structure, complete carefully that structure, and then "insert" that structure into the variable part of the request.
The request can be as complex as you need. Any command you execute from NCPCOM should (in theory) work programmatically.

Hope this helps,
Regards,
Gustavo.

Loading...