beautypg.com

Sundance SMT6060-TCPIP User Manual

Page 22

background image

Revision 0.4

Page 22 of 22

Sundance Digital Signal Processing Inc.

4790 Caughlin Parkway 233, Reno, NV 89519-0907, U.S.A.

Tel: +1 (775) 827-3103, Fax: +1 (775) 827-3664, email:

[email protected]

www.sundancedsp.com

6.5.

ECHOD EXAMPLE

This example demonstrates a telnet/ECHO server application. A task on a DSP node
initializes the sockets API, opens a listening socket and then proceeds to handle
inbound connections in a single-threaded "select loop" style. Multiple connections are possible, and each
connection will be serviced through the select-loop.

Upon a connection, the echo server will print a banner identifying the connection addresses and the
current time (the DSP does not have access to the host's clock in standalone mode). Following that,
every character received by the server will be echo-ed back.

Build and run echo.app.

Note the IP address of your SMT363 by looking at the output displayed in the HyperTerminal window.

On your development machine, run a telnet command and open a connection to the SMT363 module by
specifying its IP address. (Also select port 1).

You should see something similar to this in your telnet session window:

Connected to echo server @192.128.64.3:1 from 192.128.64.3:1622
Mon Jan

1 00:01:41 1900

At this point, any keys you type to the telnet session will be echoed back from the SMT363 network.

Connected to echo server @192.128.64.3:1 from 192.128.64.3:1622
Mon Jan

1 00:01:41 1900

ffoorr

eexxaammppllee

6.6.

FTPD EXAMPLE

This example demonstrates an FTP server application. A task on a DSP node initializes the sockets API,
and then initializes a daemon to listen on inbound FTP connections. Each daemon listens on a different
port number, thus creating a number of independent FTP servers on various ports.

By default, the first ftpd will listen on the canonical FTP control port, 21.

The higher-numbered daemons will listen on ports separated by 1000, respectively.

Build and run ftpd.app and wait until the SMT363 has obtained an IP address.

Now open an FTP session to the IP address of the SMT363. For example:

ftp> open 192.128.64.6
Connected to 192.128.64.6.
220 RTEMS FTP server (Version 1.1-JWJ) ready.
User (192.128.64.6:(none)): me
230 User logged in.
ftp>

Log in (the user name doesn’t matter).