#include #include #include #include #include #define ENDPACKET "end" #define toGuiSocketName "/tmp/cs522_2Gui" #define fromGuiSocketName "/tmp/cs522_4Gui" printmsg(char* msg, int cc) { int i; printf("Got Message:%s\n", msg); for (i= 0; i%s\n", toGuiSocketName); return sock; } int initSockToUA() { int sock; struct sockaddr_un name; /* create a unix domain socket from which to read */ sock = socket(AF_UNIX, SOCK_DGRAM, 0); if (sock < 0) { perror("opening datagram socket"); exit(1); } /* create name structure for the UNIX domain socket */ name.sun_family = AF_UNIX; strcpy(name.sun_path, fromGuiSocketName); printf("socket to UA-->%s\n", fromGuiSocketName); return sock; }