This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: tcp_lo_test.c query


On Thu, 2002-03-07 at 21:03, Kaustubh Purandare wrote:
> Thanks for your response.
> 
> But the same logic does not apply for tcp_lo_select.c
> 
> The output of tcp_lo_select.c is shown below.
> 
> Start TCP server - test
> TCP SERVER: Hello eCos network
> Start TCP client 1 - test
> client 1 :started
> Start TCP client 2 - test
> client 2 :started
> TCP SERVER connection from 127.0.0.1: 9990
> TCP SERVER connection from 127.0.0.1: 9991
> SERVER : Client 1 is alive. You may continue ....
> SERVER : Client 2 is alive. You may continue ....
> PASS:<Server returned OK>
> EXIT:<done>
> 
> Here we get loop back address from the client. In this test also 
> we don't have any explicit binding for the client socket then how 
> does it display the loopback address?
> 

Looks like you're right.  There's an error in the tcp_lo_test.c file.
This patch should fix it:

Index: net/common/current/tests/tcp_lo_test.c
===================================================================
RCS file: /home/cvs/ecc/ecc/net/common/current/tests/tcp_lo_test.c,v
retrieving revision 1.2
diff -u -5 -p -r1.2 tcp_lo_test.c
--- net/common/current/tests/tcp_lo_test.c	1 Feb 2002 16:36:57 -0000	1.2
+++ net/common/current/tests/tcp_lo_test.c	8 Mar 2002 13:32:08 -0000
@@ -113,10 +113,11 @@ void server(void)
    
     e_source = 0; 
     while (true) {
 	FD_ZERO(&in_fds);
 	FD_SET(s_source, &in_fds);
+        len = sizeof(e_source_addr);
         if ((e_source = accept(s_source,(struct sockaddr *)&e_source_addr,&len))<0) {
             pexit("accept /source/");
         }
 	diag_printf("TCP SERVER connection from %s: %d\n",
 	       inet_ntoa(e_source_addr.sin_addr),ntohs(e_source_addr.sin_port));




-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]