attempt at loopback only network test

Correo Fernando-ruiz (E-mail) correo at fernando-ruiz.com
Sat Jan 5 16:15:07 UTC 2002


This is the same case that the rtems_telnetd().

The server accept new conections. Keep the opened socket giving this
fileno() like
stdin,stdout and stderr at the new shell until the close of socket
in any side.

Seeing the rtems_telnetd() implementation this case you can see a real rtems
tcp/ip implementation.

In the case of the server rejects the MAX USERS the server telnetd() works
like you want.
Listen, accept(), open, write close.
More?.

My source was a QUE Book Linux programing with examples.
Too easy but too direct.
After a Stevens's book Bible.

BRGDS
Fernando RUIZ CASAS
home: correo at fernando-ruiz.com
work: fernando.ruiz at ctv.es



> -----Mensaje original-----
> De: Rosimildo daSilva [mailto:rdasilva at connecttel.com]
> Enviado el: viernes, 04 de enero de 2002 20:47
> Para: rtems-users at OARcorp.com
> Asunto: Re: attempt at loopback only network test
>
>
> From: Joel Sherrill <joel.sherrill at OARcorp.com>
> To: rtems-users at OARcorp.com <rtems-users at OARcorp.com>
> Date: Friday, January 04, 2002 1:33 PM
> Subject: attempt at loopback only network test
>
>
> >So if anyone could figure out what is wrong with the attached
> >code, it would sure be appreciated.  I expect it will result
> >in someone teaching me network programming basics. :)
>
>
> This test is trying to connect to a port that nobody is
> listening on it.
>
> The flow should be:
>
> main()
> {
>     - Create a server task to listen and accept connections.
>
>     - wait task above to run.
>
>     - create client socket
>     - bind it.
>     - connect.
>     - write/ read
>     - close
>
> }
>
>
> void server_task()
> {
>      - create socket
>      - make it to listen
>      while( true )
>      {
>          int soc = accept( ..... );
>
>          - read/write
>          - close
>
>      }
>
> }
>
> Hope this help. :-)
>
> Rosimildo.
>
>
>
>
>
>
>
>
>




More information about the users mailing list