Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: loxtonr@govonca.gov.on.ca (Ron Loxton)
Subject: Task-to-Task communications
Date: Thu, 23 Sep 1993 19:16:39 GMT	[thread overview]
Message-ID: <1993Sep23.191639.2073@govonca.gov.on.ca> (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);
	}
	


             reply	other threads:[~1993-09-23 19:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-23 19:16 Ron Loxton [this message]
1993-09-24  6:06 ` Task-to-Task communications jeh
read-only archive

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