This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
network problems
- From: "Larry Harmon" <harmon at hrdcorp dot com>
- To: "eCos discussion" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 9 Apr 2003 13:06:56 -0400
- Subject: [ECOS] network problems
Hello,
I have been working with rCos for about a month now. My target hardware
is a PC with an Intel ethernet card and 2 serial ports.
I am attempting to port existing embedded FW from a commercial RTOS to
eCos.
I can successfully build and run redboot and run my application using a
serial port. However I can't get ethernet support to work for me.
I have my FW configured to share the ethernet port with redboot, redboot
using the IP address 192.168.1.222 and the application using the IP address
192.168.1.223. I can ping both addresses!
I start a thread to read from the ethernet port. The thread does the
following, all successfully:
TCPComm.socket_no = socket(AF_INET, SOCK_STREAM, 0)
bind(TCPComm.socket_no, (struct sockaddr *)&sin, sizeof(sin) )
listen(TCPComm.socket_no, 3)
TCPComm.socket_active = accept(TCPComm.socket_no, (struct sockaddr
*)&sin, (socklen_t *)&sin_len))
I then try the following:
FD_ZERO(&fd_read);
FD_SET(TCPComm.socket_active, &fd_read);
select(1, (fd_set *)&fd_read, (fd_set *)0, (fd_set *)0, (struct timeval
*)NULL)
cmdSize = recvfrom(TCPComm.socket_active, (void *)Cmd, sizeof(Cmd), 0,
(struct sockaddr *)&sin, (socklen_t *)&sin_len);
However, select never returns when I send the device a message!
Is there a good example for this type of service?
I am confused about the network documentation. The 2.0b reference doesn't
document recvfrom!
I am also unable to set my socket to non-blocking IO. How is this done with
eCos?
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss