Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Task-to-Task communications
@ 1993-09-23 19:16 Ron Loxton
  1993-09-24  6:06 ` jeh
  0 siblings, 1 reply; 2+ messages in thread
From: Ron Loxton @ 1993-09-23 19:16 UTC (permalink / raw)


Netters:

	I am attempting to perform task-to-task communication between a
Vax running 
Pathworks V4.1 and my PC over decnet. I can send data from the VAX task
to my PC task
but not the other way (I get a symbolic stack dump).

Any help would be appreciated.

Please mail any suggestions to me personally

loxtonr@gov.on.ca

Thx

Ron Loxton

=============================================
Server Source:
#include <stdio.h>

FILE *TaskConnection;
char *pInputBuffer;
main()
  {
  if ((TaskConnection = fopen("SYS$NET","r+")) == NULL)   /* Open for
read+write */
    {
    puts("Cannot open network connection");
    exit(1);
    }
  puts("Connection openned");
  if (fputs("Hello There...",TaskConnection) == EOF)
    {
    puts("Connection has been closed");
    return(-1);
    }
  puts("Data Sent");
  puts("Waiting for Data from client...");
  if(fgets(pInputBuffer,100,TaskConnection)== NULL)
    {
    puts("Error Reading Line");
    }
  puts("Data Received...");
  printf("Received: %s",pInputBuffer);

/* Close connection */
  fclose(TaskConnection);
  puts("Connection closed\n\n");
  }
=============================================
Task Source:

#define DEBUG 1

#include <stdio.h>
#include <string.h>


#include "d:\dev\dneth\types.h"
#include "d:\dev\dneth\dnfundef.h"
#include "d:\dev\dneth\dn.h"
#include "d:\dev\dneth\socket.h"


int main()
	{
	char *pNodeName, *pBufferAddress;
	int iSocketNumber, iBufferSize;
	
	
	if ((pNodeName = getnodename()) != NULL)
		{
		printf("\nNode Name: %s\n",pNodeName);
		}
	else
		{
		puts("No Local Node Name Returned...");
		puts("Please contact systems officer.");
		return(1);
		}
	// Connect to TEST.EXE on remote node
	if ((iSocketNumber =
dnet_conn("nrnwpr/username/password","test.exe",1,NULL,0,NULL,0)) != -1)
		{
		#ifdef DEBUG
		  puts("Socket Openned...\n");
		  printf("Socket Number: %i\n",iSocketNumber);
		#endif
		}
	else
		{
		puts("Unable to create socket\n");
		return(-1);
		}
			
// Read from TEST.EXE
	sread(iSocketNumber,pBufferAddress,iBufferSize);
		#ifdef DEBUG
			printf("Received %s\n",pBufferAddress);
		#endif
		
// Write to TEST.EXE

	strcpy(pBufferAddress,"Hello from Ron");
	send(iSocketNumber,pBufferAddress,strlen(pBufferAddress),0);

		#ifdef DEBUG
			printf("\nSent %s\n",pBufferAddress);
			printf("\nSize: %i",strlen(pBufferAddress));
		#endif

// Close Socket
	if (sclose(iSocketNumber) == 0)
		{
		#ifdef DEBUG
			puts("\nSocket Closed...\n\n");
		#endif
		}
	else
		{
		puts("Unable to close scoket...\n\n");
		return(-1);
		}
	return(0);
	}
	


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-09-24  6:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-09-23 19:16 Task-to-Task communications Ron Loxton
1993-09-24  6:06 ` jeh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox