public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Question about TCP layer in RedBoot
@ 2005-10-06 16:55 hsy04081
  2005-10-06 17:06 ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 4+ messages in thread
From: hsy04081 @ 2005-10-06 16:55 UTC (permalink / raw)
  To: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=big5, Size: 588 bytes --]

Hi,
  It seems that TCP layer in RedBoot is just for
client-service upper layer,like http-client..,no
server-application service. Is there any pacakge for
enhancing server-service for TCP layer in RedBoot?
If yes,how to configure?

many thanks!
Sam

___________________________________________________  ×îаæ Yahoo!ÆæĦ¼´•rͨӍ 7.0 beta£¬ÃâÙM¾W·ëŠÔ’ÈÎÄã´ò£¡  http://messenger.yahoo.com.tw/beta.html

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: Question about TCP layer in RedBoot
  2005-10-06 16:55 [ECOS] Question about TCP layer in RedBoot hsy04081
@ 2005-10-06 17:06 ` Grant Edwards
       [not found]   ` <20051006174734.5309.qmail@web16807.mail.tpe.yahoo.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Edwards @ 2005-10-06 17:06 UTC (permalink / raw)
  To: ecos-discuss

In gmane.os.ecos.general, you wrote:

> It seems that TCP layer in RedBoot is just for client-service
> upper layer,like http-client.

Not really.

> no server-application service.

RedBoot includes a rudimentary telnet server, and I've done
other "servers" in RedBoot as well.

> Is there any pacakge for enhancing server-service for TCP
> layer in RedBoot?

What do you mean "enhance server-service"?

The TCP stuff in RedBoot is intentionally a bit "thin" to keep
the footpring small.

-- 
Grant Edwards                   grante             Yow!  Yow! We're going to
                                  at               a new disco!
                               visi.com            

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: Question about TCP layer in RedBoot
       [not found]   ` <20051006174734.5309.qmail@web16807.mail.tpe.yahoo.com>
@ 2005-10-06 18:12     ` Grant Edwards
  2005-10-07  1:41       ` [ECOS] 回覆: " Hunag Sun I
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Edwards @ 2005-10-06 18:12 UTC (permalink / raw)
  To: ecos-discuss

I've sent the answer to your question to the list so that
others might also benefit from it.  
http://www.catb.org/~esr/faqs/smart-questions.html#forum

[Private support is available for a fee.]

On Fri, Oct 07, 2005 at 01:47:34AM +0800, Hunag Sun I wrote:

> Firstly, thank you for replying. In TCP layer,there are no
> APIs,like bind(),accept(),socket(), these are necessary for
> "server" application.

Those are necessary for the BSD/Posix API.  They are not
necessary for a server application as long as there is a way to
accomplish the same thing.

> I can't see any server application and these APIs in
> ./packages/redboot/current/src/net.

Look in net_io.c

In net_io_init() there's a call to __tcp_listen() to set up a
tcp socket listing on a port.

In net_io_test(), there's code that checks for new connections.

In _net_io_getc_nonblock() there's code that checks for rx data
and then calls __tcp_read().

In general look for __tcp_xxxx() functions.

> Could you tell how to find them out or any way possiable for
> my "server" implementation.

Here's a rough outline:

 1) Declare a tcp_socket_t structure.

 2) Call __tcp_listen() to attach that structure to a port.

 3) Check the socket structure state field once in a while.
    When it changes to _ESTABLISHED, you've got a connection.

 4) Periodically check for rx data, if there is some, call
    __tcp_read() to read data and then __tcp_write() to write
    data.

 5) When you're done, call __tcp_close()

 6) Wait for the state to transition to _CLOSED.

 7) If you want to accept a new connection, goto 2) 


-- 
Grant Edwards
grante@visi.com

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] 回覆: [ECOS] Re: Question about TCP layer in RedBoot
  2005-10-06 18:12     ` Grant Edwards
@ 2005-10-07  1:41       ` Hunag Sun I
  0 siblings, 0 replies; 4+ messages in thread
From: Hunag Sun I @ 2005-10-07  1:41 UTC (permalink / raw)
  To: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=big5, Size: 2350 bytes --]


Thanks for your sharing.

Sam

--- Grant Edwards <grante@visi.com> »¡¡G

> I've sent the answer to your question to the list so
> that
> others might also benefit from it.  
>
http://www.catb.org/~esr/faqs/smart-questions.html#forum
> 
> [Private support is available for a fee.]
> 
> On Fri, Oct 07, 2005 at 01:47:34AM +0800, Hunag Sun
> I wrote:
> 
> > Firstly, thank you for replying. In TCP
> layer,there are no
> > APIs,like bind(),accept(),socket(), these are
> necessary for
> > "server" application.
> 
> Those are necessary for the BSD/Posix API.  They are
> not
> necessary for a server application as long as there
> is a way to
> accomplish the same thing.
> 
> > I can't see any server application and these APIs
> in
> > ./packages/redboot/current/src/net.
> 
> Look in net_io.c
> 
> In net_io_init() there's a call to __tcp_listen() to
> set up a
> tcp socket listing on a port.
> 
> In net_io_test(), there's code that checks for new
> connections.
> 
> In _net_io_getc_nonblock() there's code that checks
> for rx data
> and then calls __tcp_read().
> 
> In general look for __tcp_xxxx() functions.
> 
> > Could you tell how to find them out or any way
> possiable for
> > my "server" implementation.
> 
> Here's a rough outline:
> 
>  1) Declare a tcp_socket_t structure.
> 
>  2) Call __tcp_listen() to attach that structure to
> a port.
> 
>  3) Check the socket structure state field once in a
> while.
>     When it changes to _ESTABLISHED, you've got a
> connection.
> 
>  4) Periodically check for rx data, if there is
> some, call
>     __tcp_read() to read data and then __tcp_write()
> to write
>     data.
> 
>  5) When you're done, call __tcp_close()
> 
>  6) Wait for the state to transition to _CLOSED.
> 
>  7) If you want to accept a new connection, goto 2) 
> 
> 
> -- 
> Grant Edwards
> grante@visi.com
> 
> -- 
> Before posting, please read the FAQ:
> http://ecos.sourceware.org/fom/ecos
> and search the list archive:
> http://ecos.sourceware.org/ml/ecos-discuss
> 
> 


___________________________________________________  ×îаæ Yahoo!ÆæĦ¼´•rͨӍ 7.0 beta£¬ÃâÙM¾W·ëŠÔ’ÈÎÄã´ò£¡  http://messenger.yahoo.com.tw/beta.html

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-07  1:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-06 16:55 [ECOS] Question about TCP layer in RedBoot hsy04081
2005-10-06 17:06 ` [ECOS] " Grant Edwards
     [not found]   ` <20051006174734.5309.qmail@web16807.mail.tpe.yahoo.com>
2005-10-06 18:12     ` Grant Edwards
2005-10-07  1:41       ` [ECOS] 回覆: " Hunag Sun I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).