DAVID WOLVERTON wrote: > I suspect she is writing a CLIENT socket service that > RUNS on the server -- one where I'm opening a socket to > get data from another service - and as any process could > be doing the same, I'd just want the next available > socket, please.... So I think the request is valid -- > remember - our 3GL could be a consumer of someone's > service...
Hmm, I was going to agree with you David. (I've written a robust D3 socket client to function as a consumer as you describe.) But after re-reading her first point I'm convinced that she wants a single U2 listener process to spawn another socket server, maybe a number of them. Glen may be right on the FTP server analogy. I'm guessing the process goes like this: - Start socket server on a well-known port. - Client connects. - App needs to create another socket server port for this specific client communicate on so that the well-known server port can remain open. - On successfully opening a new random server port, U2 host sends the new port# to the client so that the client can disconnect and reconnect in on the new port. Gyle wants to let the system assign the port for this new server and appropriately points out that this "should" be managed at a level below the application. Unfortunately being right often gets us nowhere - a dedicated socket pool may be required, say from 64000-65000. The other problem is that because initsocketserver doesn't fail if it binds to a socket already in use (not confirmed and may be release-specific), the app could be returning a port# which the client cannot communicate on. In this case I'd say the client should tell the U2 host that the connection failed and it needs another port. Since the app is managing the pool, the bad port is still removed from the pool and is no longer available to be re-assigned to some other client, the app may need to release the handle. Gyle, I really think you should reconsider use of netstat to tell you what ports are already in use. These are rotten solutions and there are a bunch of things that can go wrong here which will require handshaking between multiple U2 ports and/or polling, and some housekeeping process to refresh the pool, release resources, etc. I don't think there are any elegant solutions here or we'd see a lot more sites doing this. I don't think I can offer much more, sorry. T ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
