mbed socket API

Dependents:   EthernetInterface EthernetInterface_RSF EthernetInterface EthernetInterface ... more

shutdown that supports SHUT_RD or SHUT_WR or SHUT_RDWR

Socket::close can call shutdown when it argument is true. However, shutdown is always called using SHUT_RDWR where both send and receive channels are closed (in fact, reset). When you do such kind of shutdown in a http connection, the other side (browser) may report this situation as an error and some data may be lost (if RST is sent together data). It would be better to shutdown using only SHUT_WR (closing only your side) or give the option to the user by argument.

How about adding a shutdown method, with support for SHUT_RD , SHUT_WR and SHUT_RDWR, like in any other BSD socket stack ? Or to change close() to support these three shutdown options.

See more: http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#closedown

Socket::close() now supports an additional parameter for defining the shutdown type socket

1 comment:

10 Sep 2015

No answer or evaluation .... #worried