krodgers@boulder.Colorado.EDU (Kevin Rodgers) (08/21/90)
[I'm posting this for a friend who doesn't have access to usenet; please reply to bill@b52.den.mmc.com; don't followup] We are trying to build a database server-like software system that consists of a server and many clients on a ethernet LAN. The server will listen for connections from any of the clients. The clients will repeatedly request connects to the server to retrieve information. Once the retrieve is complete the client will disconnect from the server, freeing the server to respond to other clients. We are experiencing difficulties using NSCA telnet to implement this architecture. Here is the simplified code of the client: client_main { Snetinit(); do { interact_with_user(); Snetopen(); netwrite(); netread(); netclose(); } while(!done); } Here is the simplified code for the server: server_main { Snetinit(); diddy = 1; do { netlisten(); netread(); netwrite(); netclose(); } while(diddy); /* the dreaded do wa diddy */ } This code seems to work perfectly the first time through. On subsequent connections problems start to appear. The most significant seems to be that the client is receiving a packet for an invalid port (error message is "Packet received for invalid port -- reset sent"). Most client programs like lpr, tend to always do a netshut and then the program exits. We are hoping to avoid reinitializing (netinit) and shutting down (netshut) the hardware everytime the client wants to connect to the server. Question: Has anyone written some NSCA telnet code that does a simple server-client architecture? or does anyone have any pointers on how to do this? Any help would be appreciated. Please send e-mail to: bill@b52.den.mmc.com Thanks, Bill Pardee Kevin Rodgers krodgers@boulder.colorado.edu Department of Computer Science GO BUFFS! University of Colorado Boulder CO 80309-0430