Any ideas? void forkExec()Īddress.sin_port = htons(POLLING_SERVER_PORT) If the script/client app is called manually the socket() call performs appropriately and things work fine.īased on that information I suspect it's something in my fork() execvp() code below. NOTE: This ONLY occurs when the script/client app is called using my forkExec() function. My issue is that the client app gets a value of 0 returned by the socket() system call. The script sends these errors by calling another application (client) which opens a TCP socket and sends the appropriate data. The problem is that at times the script reports errors to the server app. I fork() and then in the child I close all the server sockets and then call execvp() to execute the script. Initially, I was using system() to execute this external script, but we couldn't use that because we had to make sure the server sockets were closed in the child that was forked to execute the external script. This script calls a utility (client) that sends a message to one of the server sockets. I'm working on an application that contains several server sockets that each run in a unique thread.Īn external utility (script) is called by one of the threads.
0 Comments
Leave a Reply. |