public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Issue 1001027] New: Checking whether the client is connected to the Server usin netconn lwIP
@ 2010-08-30 13:12 bugzilla-daemon
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla-daemon @ 2010-08-30 13:12 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
https://bugzilla.ecoscentric.com/show_bug.cgi?id=1001027

           Summary: Checking whether the client is connected to the Server
                    usin netconn lwIP
           Product: eCos
           Version: unknown
          Platform: Other (please specify)
        OS/Version: Other
            Status: UNCONFIRMED
          Severity: normal
          Priority: normal
         Component: lwIP
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: tecknicalgreek@hotmail.com
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


Hi, 
I am working on establishing Client-Server module over TCP.I have put a set up
such that my PC acts as a normal server where I can connect it from some other
PC's on my LAN using 'telnet ipaddress port' command and once I get connected
with the server and can give some input from client computer so that it gets
displayed on my server window(connection is established and data exchange takes
place). 
Until here I can say that the server is working fine and what i wanted to
implement is that now I wrote a code using lwIP API for the Altium Nanaboard so
that my NB3000 acts like a client and i wanted it to get connected to my PC
Server. 
Here goes my code for the client part which gets connected to the Server with
given IPaddress. 

int tcp_client(void) 
{ 
char data[] = "Hello World"; 
struct netconn *conn; 
struct ip_addr ServAddr; 
err_t err; 
u16_t port; 

port = 7777; 

conn = netconn_new(NETCONN_TCP); 

IP4_ADDR(&ServAddr, 192,168,xx,xxx); 

err = netconn_connect(conn, &ServAddr, port); 

printf("err = %d", err); 

if(err == ERR_OK) 

netconn_write(conn, data, sizeof(data), NETCONN_NOCOPY); 

netconn_close(conn); 

netconn_delete(conn); 
} 
} 

here i open a new connection and connect it to Server using its IPaddress. 

Before that I wanted to check the connection whether it is connected or not, so
what i did is i assigned a variable "err" and when I try to print it out on the
terminal instrument and see the value it gives a value of "-4". 
Is this correct what I am doing here so that if i get a negative value that
means the client is successfully connected to the server. 
If so how can i transfer the data "Hello World" on to my server and get it
displayed there. 
Let me know whether I am on right track or am I missing something. 
Kind Regards, 
Greek

-- 
Configure issuemail: https://bugzilla.ecoscentric.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the issue.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Issue 1001027] New: Checking whether the client is connected to the Server usin netconn lwIP
@ 2010-08-30 13:12 bugzilla-daemon
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla-daemon @ 2010-08-30 13:12 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
https://bugzilla.ecoscentric.com/show_bug.cgi?id=1001027

           Summary: Checking whether the client is connected to the Server
                    usin netconn lwIP
           Product: eCos
           Version: unknown
          Platform: Other (please specify)
        OS/Version: Other
            Status: UNCONFIRMED
          Severity: normal
          Priority: normal
         Component: lwIP
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: tecknicalgreek@hotmail.com
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


Hi, 
I am working on establishing Client-Server module over TCP.I have put a set up
such that my PC acts as a normal server where I can connect it from some other
PC's on my LAN using 'telnet ipaddress port' command and once I get connected
with the server and can give some input from client computer so that it gets
displayed on my server window(connection is established and data exchange takes
place). 
Until here I can say that the server is working fine and what i wanted to
implement is that now I wrote a code using lwIP API for the Altium Nanaboard so
that my NB3000 acts like a client and i wanted it to get connected to my PC
Server. 
Here goes my code for the client part which gets connected to the Server with
given IPaddress. 

int tcp_client(void) 
{ 
char data[] = "Hello World"; 
struct netconn *conn; 
struct ip_addr ServAddr; 
err_t err; 
u16_t port; 

port = 7777; 

conn = netconn_new(NETCONN_TCP); 

IP4_ADDR(&ServAddr, 192,168,xx,xxx); 

err = netconn_connect(conn, &ServAddr, port); 

printf("err = %d", err); 

if(err == ERR_OK) 

netconn_write(conn, data, sizeof(data), NETCONN_NOCOPY); 

netconn_close(conn); 

netconn_delete(conn); 
} 
} 

here i open a new connection and connect it to Server using its IPaddress. 

Before that I wanted to check the connection whether it is connected or not, so
what i did is i assigned a variable "err" and when I try to print it out on the
terminal instrument and see the value it gives a value of "-4". 
Is this correct what I am doing here so that if i get a negative value that
means the client is successfully connected to the server. 
If so how can i transfer the data "Hello World" on to my server and get it
displayed there. 
Let me know whether I am on right track or am I missing something. 
Kind Regards, 
Greek

-- 
Configure issuemail: https://bugzilla.ecoscentric.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the issue.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-30 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-30 13:12 [Issue 1001027] New: Checking whether the client is connected to the Server usin netconn lwIP bugzilla-daemon
2010-08-30 13:12 bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).