$CASE/04s522/DBDE_Client/DBDE_Test.040516 - RJL 040516:0120(Rev.) I did make in BDE_Client and got player .exe file. gdb player and run produced this: ------------------------------ Using default values. Connecting to hostname[127.0.0.1] through port[42028]. Initializing socket connection InitSocket(), connect() system call failed. Exiting... Program exited with code 01. (gdb) globals.o Undefined command: "globals". Try "help". (gdb) info stack No stack. ----------------------- I did not run Server first. It did not compile on saturn: In rherrick/DBDE_Server: ---------------------- make gcc -g -I. -g3 -c main.c main.c: In function `RcvThread': main.c:274: warning: cast from pointer to integer of different size main.c: In function `InitSocket': main.c:465: warning: cast to pointer from integer of different size gcc -g -I. -g3 -c globals.c -o globals.o gcc -g -I. -g3 -c queue.c -o queue.o gcc -g -I. -g3 -c cardset.c -o cardset.o gcc -g -L/usr -lpthread main.o globals.o queue.o cardset.o -o server /usr/bin/ld: Unresolved: sem_wait sem_post sem_init collect2: ld returned 1 exit status *** Exit 1 Stop. ----------------------- I reran make on mercury in DBDE_Server and it worked: mercury.cs.uml.edu(12)> make make gcc -g -I. -g3 -c main.c gcc -g -I. -g3 -c globals.c -o globals.o gcc -g -I. -g3 -c queue.c -o queue.o gcc -g -I. -g3 -c cardset.c -o cardset.o gcc -g -L/usr -lpthread main.o globals.o queue.o cardset.o -o server mercury.cs.uml.edu(13)> lst lst total 376 4 drwx--x--x 3 lechner fac 4096 May 16 00:50 . 24 -rw------- 1 lechner fac 21336 May 16 00:50 cardset.o 32 -rw------- 1 lechner fac 32548 May 16 00:50 globals.o 32 -rw------- 1 lechner fac 31804 May 16 00:50 queue.o 80 -rwx------ 1 lechner fac 75491 May 16 00:50 server 60 -rw------- 1 lechner fac 53768 May 16 00:50 main.o --------------------- ~ Mixed-host run test failed: I started the server under gdb : -------------------------------- exec /nfs/earth/faculty/fac1/lechner/04s522/CaseDiry.040515/rherrick/DBDE_Server/server.exe [Thread debugging using libthread_db enabled] [New Thread 8192 (LWP 4426)] [New Thread 16385 (LWP 4433)] [New Thread 8194 (LWP 4434)] [New Thread 16387 (LWP 4435)] DBDE Server is listening at port[42028]. Waiting for a new client connection... ------------------------------ But the Client on saturn did not work: ------------------------- exec /nfs/earth/faculty/fac1/lechner/04s522/CaseDiry.040515/rherrick/DBDE_Client/player Using default values. Connecting to hostname[127.0.0.1] through port[42028]. Initializing socket connection InitSocket(), connect() system call failed. Exiting... Program exited with code 01. (gdb) q saturn.cs.uml.edu(99)> pwd pwd /nfs/earth/faculty/fac1/lechner/04s522/CaseDiry.040515/rherrick/DBDE_Client ------------------------- Apparently a Linux Server cannot talk to an alpya CLient: So I recompiled the CLient on mercury also, and now it works: ------------------------------------------------------- exec /nfs/earth/faculty/fac1/lechner/04s522/CaseDiry.040515/rherrick/DBDE_Client/player [Thread debugging using libthread_db enabled] [New Thread 8192 (LWP 4684)] Using default values. Connecting to hostname[127.0.0.1] through port[42028]. Initializing socket connection [New Thread 16385 (LWP 4692)] [New Thread 8194 (LWP 4693)] Creating Receiver thread ########################BEGIN INFORMATION####################### DBDE Server ID = [1] My Player ID = [1] My Score = [0] Card 1 has 1 red square solid shapes on it Card 2 has 2 green triangular lined shapes on it Card 3 has 2 green square solid shapes on it Card 4 has 2 blue circular lined shapes on it Card 5 has 2 green circular outlined shapes on it Card 6 has 1 red triangular lined shapes on it Card 7 has 2 blue triangular outlined shapes on it Card 8 has 1 red triangular outlined shapes on it Card 9 has 3 red triangular outlined shapes on it Card 10 has 2 blue triangular lined shapes on it Card 11 has 3 green circular solid shapes on it Card 12 has 2 red circular outlined shapes on it Choose a set of 3 cards [set format:: ,,] OR type quit to exit > ---------------------------------------------------------- QUESTION: What is the Server exit strategy? and is it safe? I did quit to player, then CTRL_C to server. This is the Server-side log: -------------------- exec /nfs/earth/faculty/fac1/lechner/04s522/CaseDiry.040515/rherrick/DBDE_Server/server.exe [Thread debugging using libthread_db enabled] [New Thread 8192 (LWP 4426)] [New Thread 16385 (LWP 4433)] [New Thread 8194 (LWP 4434)] [New Thread 16387 (LWP 4435)] DBDE Server is listening at port[42028]. Waiting for a new client connection... InitSocket(), DBDE Server[1] accepted new client connection[1] on port [42028] layout=0,dimension=1,shape=2,color=0,number= 0;layout=1,dimension=0,shape=1,color=2,number= 1;layout=2,dimension=1,shape=2,color=2,number= 1;layout=3,dimension=0,shape=0,color=1,number= 1;layout=4,dimension=2,shape=0,color=2,number= 1;layout=5,dimension=0,shape=1,color=0,number= 0;layout=6,dimension=2,shape=1,color=1,number= 1;layout=7,dimension=2,shape=1,color=0,number= 0;layout=8,dimension=2,shape=1,color=0,number= 2;layout=9,dimension=0,shape=1,color=1,number= 1;layout=10,dimension=1,shape=0,color=2,number= 2;layout=11,dimension=2,shape=0,color=0,number= 1; [New Thread 24580 (LWP 4691)] SndThread(), Sending DownLoadEvent to client[1]. Waiting for a new client connection... ReceiveData(), Client Disconnected. RcvThread(), client[1] disconnecting... Clean up client[1] resources quit Program received signal SIGINT, Interrupt. [Switching to Thread 16387 (LWP 4435)] 0x40088be5 in __sigsuspend (set=0x4119598c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:45 45 ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or directory. in ../sysdeps/unix/sysv/linux/sigsuspend.c (gdb) q The program is running. Exit anyway? (y or n) y mercury.cs.uml.edu(57)> -----------------------