Getting Started with ADSP-BF537 EZ-KIT Lite
2-13
Running a TCP/IP application on an ADSP-BF537 EZ-KIT Lite
{
struct sockaddr_in saddr;
int listenfd;
if ( 0 > ( listenfd = socket ( AF_INET, SOCK_STREAM, 0 ) ) )
{
printf ( "Call to socket() failed.\n" );
abort();
}
memset ( &saddr, 0, sizeof ( saddr ) );
saddr.sin_family = AF_INET;
saddr.sin_addr.s_addr = htonl ( INADDR_ANY );
saddr.sin_port = htons ( 23 ); /* listening on port 23
(well-known default "telnet") */
if ( -1 == bind ( listenfd, (struct sockaddr*) &saddr,
sizeof(saddr) ) )
{
printf ( "Call to bind() failed.\n" );
abort();
}
if ( -1 == listen ( listenfd, 0 ) )
{
printf ( "Call to listen() failed.\n" );
abort();
}
for ( ;; )
{
struct sockaddr cliaddr;
int clilen;
int iSocket;
iSocket = accept (listenfd, &cliaddr, &clilen);
if ( -1 == iSocket )
{
printf ( "Call to accept() failed.\n" );
abort();
www.BDTIC.com/ADI
Содержание EZ-KIT Lite ADSP-BF537
Страница 4: ...www BDTIC com ADI ...
Страница 8: ...CONTENTS viii Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...
Страница 52: ...Listing 1 3 Exercise 1 Part 3 1 30 Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...
Страница 88: ...What s Next 3 22 Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...