Operating System - OpenVMS
1827845 Members
1212 Online
109969 Solutions
New Discussion

C socket programming, accept doesn't work on queue

 
SOLVED
Go to solution
mustafa_12
Frequent Advisor

C socket programming, accept doesn't work on queue

Hello,

I have written a C socket programming on OpenVMS 7.3.2. The program has "socket, bind, listen and accept" command sequences in it and working properly when I run it at the command prompt with "run x.exe". However when I put it in a DCL file and make it run on a queue, it couldn't run. It makes socket, bind and listen commands successfully but it couldn't make "accept" command in the source file. It is just seen working (by show queu...) but in the log file it can't reach the accept line. How can I make it run using the queue...

Best Regards...
6 REPLIES 6
Volker Halle
Honored Contributor

Re: C socket programming, accept doesn't work on queue

Mustafa,

does the program work, if you run the DCL command file interactively (@x.com) instead of submitting it into a batch queue ?

Volker.
Martin Vorlaender
Honored Contributor

Re: C socket programming, accept doesn't work on queue

Do you check the return values of your (bind,listen,accept) calls? If one of them is -1, what does errno contain?

cu,
Martin
mustafa_12
Frequent Advisor

Re: C socket programming, accept doesn't work on queue

Volker,

Yes, it is working if I run the DCL command file by @xxx.com. Also, I can check it by "tcpip netstat -an" and see that the port is in LISTEN state. However, when I submit the DCL command file to a queue and then "tcpip netstat -an", I could not see the port in LISTEN state...

Thanks...
Volker Halle
Honored Contributor
Solution

Re: C socket programming, accept doesn't work on queue

Mustafa,

wouldn't this indicate, that it's not successfully completing the LISTEN call ?

The batch job is run on the same node, right ?

Volker.
Volker Halle
Honored Contributor

Re: C socket programming, accept doesn't work on queue

Mustafa,

the local port number should even be visible immediately after the BIND call.

Please check the return status of these calls.

Volker.
mustafa_12
Frequent Advisor

Re: C socket programming, accept doesn't work on queue

Yes, you are right. The queue that I submit the job is running in another node. So that node is listening the port. Actually it was running at the same node that I submit the job, but the queue migrated to another node since the development node (that I submitted the job) was rebooted 3 days ago. Sorry, I have missed that point.

Anyway, I thank you all for your fast and guiding responses...

BR...