IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cobol EZASOKET call to SETSOCKOPT fails


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Thu Oct 06, 2016 7:12 pm
Reply with quote

hello,

I try to set an Socket timout for recv using EZASOKET with SETSOCKOPT SO_RCVTIMEO:

www.ibm.com/support/knowledgecenter/SSLTBW_1.13.0/com.ibm.zos.r13.halc001/csetopt.htm

Code:
00122         01 .                                                     
00123            05  EZA-FUNCTION            PIC X(16).               
00124            05  EZA-ERRNO               PIC S9(8) BINARY.         
00125            05  EZA-RETCODE             PIC S9(8) BINARY.         
00140 AS_014     05  EZA-OPTNAME             PIC 9(8)  BINARY.         
00141 AS_014     05  EZA-OPTVAL.                                       
00142 AS_014         10 EZA-OPTVAL-SEC       PIC 9(16)  BINARY.         
00143 AS_014         10 FILLER               PIC 9(8)  BINARY VALUE 0.
00144 AS_014        10 EZA-OPTVAL-USEC      PIC 9(8)  BINARY VALUE 0.
00145 AS_014     05  EZA-OPTLEN              PIC 9(8)  BINARY.         


Code:
00770 AS_014     MOVE 'SETSOCKOPT'         TO EZA-FUNCTION           
00771 AS_014     MOVE 4102                 TO EZA-OPTNAME           
00772 AS_014     MOVE 30                   TO EZA-OPTVAL-SEC         
00773 AS_014     MOVE LENGTH OF EZA-OPTVAL TO EZA-OPTLEN             
00779 AS_014     CALL  'EZASOKET' USING      EZA-FUNCTION           
00780 AS_014                                 EZA-S                   
00781 AS_014                                 EZA-OPTNAME             
00782 AS_014                                 EZA-OPTVAL             
00783 AS_014                                 EZA-OPTLEN             
00784 AS_014                                 EZA-ERRNO EZA-RETCODE   
00785 AS_014     IF EZA-RETCODE NEGATIVE THEN                       
00786 AS_014          GO TO ERROR-IN-SOKET                           
00787 AS_014     END-IF                                             


I want a timeout of 30 seconds. But always get the error 180. But I can not find any description about this error.

I think my EZA-OPTVAL declaration is wrong.

www.ibm.com/support/knowledgecenter/en/SSLTBW_1.13.0/com.ibm.zos.r13.halc001/cgetopt.htm#optname
Quote:
This option requires a TIMEVAL structure, which is defined in SYS1.MACLIB( BPXYRLIM) macro. The TIMEVAL structure contains the number of seconds and microseconds specified as fullword binary numbers. The seconds can be a value in the range 0 - 2 678 400 (equal to 31 days), and the microseconds can be a value in the range 0 - 1 000 000 (equal to 1 second). Although TIMEVAL value can be specified using microsecond granularity, the internal TCP/IP timers that are used to implement this function have a granularity of approximately 100 milliseconds.


This BPXYRLIM I found here:
www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r1.bpxb100/yrlim64.htm

Hope somebody can help...[/code]
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Thu Oct 06, 2016 8:03 pm
Reply with quote

I get error no 10180 which means:

Quote:
The parameter list for a SETSOCKOPT call is incorrect.


My output field for error number was to short...

But still i can not find out what exactly is the problem.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 06, 2016 10:20 pm
Reply with quote

The link you have in your post specifically has OPTVAL as PIC 9(8) BINARY -- which is far different from what you have. If you don't define the variables as they are in the manual, don't expect zero return codes.
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Fri Oct 07, 2016 11:17 am
Reply with quote

I also tried with OPTVAL PIC9(8) or course. I think i tried nearly all declarations of OPTVAL.

I did this delaration above because it was written that
Quote:
This option requires a TIMEVAL structure, which is defined in SYS1.MACLIB( BPXYRLIM) macro. The TIMEVAL structure contains the number of seconds and microseconds specified ...


This structure I found here www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb100/yrlim64.htm

Code:
TIMEVAL              DSECT ,      Timeval structure                             
TMVL_SEC             DS    FD     Seconds                                       
                     DS    F      Padding                                       
TMVL_USEC            DS    F      Microseconds                                 
TIMEVAL#LENGTH       EQU *-TIMEVAL Length of this DSECT
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 07, 2016 12:46 pm
Reply with quote

The TIMEVAL structure is used by an entirely different function.

You need to pass exactly what is described in your first link.

I doubt that it matters, but why did you make some of them signed? You don't show EZA-S, which contains the socket number you are interested in.

You are collecting information to do the GET, you are not doing the GET.
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Fri Oct 07, 2016 1:03 pm
Reply with quote

Yes you are right, I also played around with signed and unsigned. I am using EZA-S and some of the other fields also for the other EZASOKET calls and they are working fine.

The SO_LINGER, RECVTIMEO are exceptions where you do not have to pass an integer. And then you also have to set the length to an different value than integer length.

But I start to believe that our system z/VSE 5.1 does not support this option to set a socket timeout. Maybe thats the reason why it is not working.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 07, 2016 1:53 pm
Reply with quote

IBM z/VSE, z/VSE TCP/IP Support, Version 5 Release 1
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top