- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made this post earlier under the microC-subject, however, I would also be interesting in a general standalone example using lwIP.
I am trying to make a TCP connection to a server with a nios II dev board. Does anyone have an example code on how that is done. I have tried with the following code with failing results, I think it has something to do with the destination IP. The destination address is 192.168.1.2 which is set below. conn_sock = socket(AF_INET, SOCK_STREAM, 0); addr2.sin_family = AF_INET; addr2.sin_port = htons(5824); addr2.sin_addr.s_addr = inet_addr("192.168.1.2"); connect(conn_sock, (struct sockaddr *)&addr2, sizeof(struct sockaddr_in)); send(conn_sock, buf, strlen(buf), 0); close(conn_sock); Cheers. /ELink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by bigmickey@Feb 2 2006, 10:24 AM http://forum.niosforum.com/forum/index.php?showtopic=949 (http://forum.niosforum.com/forum/index.php?showtopic=949)
is what you need
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12502)
--- quote end ---
--- Quote End --- I am looking for an example that makes a TCP connection under uC/OSII, the only examples I have found are servers and perhaps some UDP-broadcast. Allthough I have managed to make a UDP send to a particular IP by using: inet_addr("123.123.123.123") Still no luck for the TCP one. /E
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by enil@Jan 24 2006, 04:12 PM i would also be interesting in a general standalone example using lwip. --- Quote End --- And so i thought for no operating system. You can see on altera site for simple_socket_server perhaps
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page