|
Also, you might have better luck using SOCK_STREAM instead of SOCK_DGRAM. 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 +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.