• Subject: RE: errors during bind
  • From: Bob Crothers <bcrothers@xxxxxxxxxxxxx>
  • Date: Thu, 23 Apr 1998 13:23:13 -0000

I just thought of one problem I was having first time I did 
sockets on the 400.

After you run your program, do a WRKTCPSTS *CNN...make sure your 
socket is not active anymore.  When I was starting, the socket 
frequently remained active.  Use option 4 to terminate the 
socket.  And as Patrick says, the job log frequently has very 
valueable info.

Bob

-----Original Message-----
From:   Patrick Townsend [SMTP:townsend@patownsend.com]
Sent:   Thursday, April 23, 1998 10:17 AM
To:     MIDRANGE-L@midrange.com
Subject:        Re: errors during bind

Some thoughts on your questions:

1. You can sometimes get useful information on a bind error with 
the
strerror function:

     char *error_message;
     error_message = strerror(errno);

   Try this to see if their is more information about the bind 
error. It
might also
   help with the unknown error condition.

2. Set application logging on high, run the program again and 
check the
job log. Their is often
   useful information in the job log:

     chgjob log(4 0 *seclvl) logclpgm(*yes)
     call mypgm
     dspjoblog

3. I've used UNIX sockets on the AS/400 and you should be able 
to get
this to work. Check
   to be sure the file you are using does not already exist 
before the
bind (use unlink() or
   whatever...

Hope this helps,
Patrick

PhaniHR wrote:
>
>      Hi,
>
>      We have this serious problem. Please help us to resolve 
this at this
>      earliest. We got the following errors during bind on 
AS/400
>
>      - EINVAL (The value specified for the argument is not 
correct.) -
>      EUNKNOWN (Unknown system state.)
>
>      These errors occured at different times and persisted for 
sometime.
>      EINVAL was solved by doing an IPL. But EUNKNOWN persisted 
even after
>      doing an IPL.
>
>
>      Doubts :
>
>      1. What does EUNKNOWN mean ?
>      2. Under what conditions does EUNKNOWN occur during bind 
? 3. What are
>      the corrective actions for EUNKNOWN ?
>      4. If EUNKNOWN error happens again, what are the steps we 
should take
>      in order to give more information to you ?
>      5. What do we have to do to prevent EUNKNOWN from 
happening again ? 6.
>      What do we have to do to prevent EINVAL from happening 
again ?
>      7. How can we find out whether a particular address (say, 
"RS2000" for
>      UDP socket) is already in use ? What we would like to 
know is how   we
>      can find from a program (say A) that a particular address 
is in  use
>      by a different program (say B).
>
>
>
>      The code is as follows
>
>      ....
>      ....
>
>      int CreateUDPSock(char * UDPFile)
>      {
>      struct sockaddr_un servaddr;
>      int servlen, sockfd;
>
>      memset(&servaddr,'\0', sizeof(servaddr)); 
servaddr.sun_family =
>      AF_UNIX; strcpy(servaddr.sun_path, UDPFile);
>      servlen = SUN_LEN(&servaddr);
>
>      if((sockfd=socket(AF_UNIX,SOCK_DGRAM,0)) < 0) { 
printf("Error opening
>      UDP socket\n"); return -1; }
>
>      unlink(UDPFile);
>      errno = 0;           /* Ignore the EBADF error */
>
>      if(bind(sockfd,(struct sockaddr *)&servaddr,servlen) < 0) 
{
>      perror("error in bind");          /* ERROR noticed here 
*/ return -1;
>      }
>
>      return sockfd;
>      }
>
>      void main()
>      {
>      int sockfd;
>
>      sockfd = CreateUDPSock("RS2000");
>      ....
>      ....
>      }
>
>
>
>
>      Best regards,
>
>      Phaniraj
>
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to 
MIDRANGE-L@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
> +---

--

Patrick Townsend 
                      mailto:townsend@patownsend.com
Patrick Townsend & Associates, Inc.    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 unsubscribe from this list send email to 
MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: 
david@midrange.com
+---

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.