|
David, A couple of ways you can do this: 1. Use the spawn() function. Fork is not implemented. The UNIX system reference manual should give you some hints on how to do this. V3R2 is not a great platform for spawn, so you might want to look at the next option. 2. Use the givedescriptor() and takedescriptor() functions. It's a little weird, but works. You start an application that puts its job information on a data queue and waits for a response. Your server application listens/accepts a connection, reads the data queue, gives the descriptor to the job waiting for it. There's an example somewhere (in the C or TCP/IP manuals). Patrick David Gibbs wrote: > > Ok, here's a question for all you "Bare Metal" Programmers out there... > > I've got a simple TCP/IP server written in V3R2 RPGLE and it works ... but I > need to make the process more robust. > > I need my server program to be able to handle multiple clients at the same > time... but in a "Stateful" manner (i.e., the server has to do a whole bunch > of work for the client and keep track of what is going on). Kinda like > evoking an ICF comms program and carrying on a conversation (send, receive, > send receive, etc). > > >From my research, I've determined that if the server were written in C... on > Unix... I would use the "fork()" operation to detach from the current > process into a child process and the socket would handed off to the child. > The server program would then allocate another socket and go back into a > "listen()" mode. > > Is this basic logic possible to do in V3R2 RPGLE? Am I biting off more than > I can chew? > > Thanks! > > david > > > -- > > David Gibbs > Sr. Software Engineer > Mortice Kern Systems US, Inc. > 2500 S. Highland Ave., Suite 200 > Lombard, IL 60148 > > phone: (630) 495-2108 x5004 > http://www.mks.com <http://www.mks.com/> > mailto:dgibbs@mks.com <mailto:dgibbs@mks.com> > > Opinions expressed are strictly my own and do > not necessarily reflect those of my employer. > > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- -- IBM AS/400 communications, FTP automation, and network security software and consulting services. http://www.patownsend.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.