From: Karthik <kar...@ya...> - 2005-01-25 04:59:47
|
I have done as suggested but i was unsuccessfil. I am pasting below some code of the client program. #define SRV_IP_ADRS_1 "192.168.2.100" #define SRV_IP_ADRS_2 "192.168.2.101" struct sockaddr_in sin[2]; if ((sock_fd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)) == -1) perror("\nCannot create socket\n"); sin[0].sin_family = AF_INET; sin[0].sin_port = htons(3333); sin[0].sin_addr.s_addr = inet_addr(SRV_IP_ADRS_1); if(connect(sock_fd,(struct sockaddr *)&sin[0],sizeof(struct sockaddr_in)) < 0) { perror("\nCan't connect to server\n"); exit(0); } sin[1].sin_family = AF_INET; sin[1].sin_port = htons(3333); sin[1].sin_addr.s_addr = inet_addr(SRV_IP_ADRS_2); if(connect(sock_fd,(struct sockaddr *)&sin[1],sizeof(struct sockaddr_in)) < 0) { perror("\n 2nd connect Can't connect to server\n"); exit(0); } The above code fails at the second connect call giving the error "Transport endpoint already connected". Can you please help me with this. Thanking you Karthik --- lks...@li... wrote: > Date: Sun, 23 Jan 2005 07:28:30 -0800 (PST) > From: Anatoly Khusid <tol...@ya...> > Subject: Re: [Lksctp-developers] Help with > multihoming > To: Karthik <kar...@ya...>, > SCTP Forum > <lks...@li...> > > --0-503646642-1106494110=:23201 > Content-Type: text/plain; charset=us-ascii > > >When connecting to the server through the client as > >sctp_connectx() is not yet available, > > I would call connect() in a loop for all destination > (server) IP addresses. > As soon as one connect() is successful, you can > stop. > I dont think there are socket options that will > allow you to do that. > > > Karthik <kar...@ya...> wrote: > > Hello!! > > I am trying to create a multihomed association > between > a server and client. > > I have a server program which uses sctp_bindx() and > binds to 1 or more IP addresses. > > When connecting to the server through the client as > sctp_connectx() is not yet available, > > 1. What options do i need to set on the client > (socket) side such that if one IP fails on the > server > side the client takes the other IP address and > transfers data to it (Its like detecting the IP is > not > working anymore and choosing another IP, how do i do > it ?). > > 2. To perform the above task what are the msg > notifications i need to capture ? > > Thanks for the help in advance. > > Karthik > __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 |