socket-handler: don't set global O_NONBLOCK flag on client sockets

We will want to perform blocking writes in a future change, and setting
O_NONBLOCK on the file descriptor makes this difficult. Instead, don't
specify O_NONBLOCK, and use send/recv (which allows us to specify
MSG_DONTWAIT) instead of write/read.

Change-Id: I425b1e4fd37c51e27a9f334dfeff344bb7bc5f97
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
1 file changed
tree: 2658e8e729b92b4dc4eba0d0b5969b7033d2c1a5
  1. test/
  2. .travis.yml
  3. bootstrap.sh
  4. config.c
  5. configure.ac
  6. console-client.c
  7. console-server.c
  8. console-server.h
  9. console-socket.c
  10. LICENSE
  11. log-handler.c
  12. Makefile.am
  13. obmc-console.conf.sample
  14. README.md
  15. socket-handler.c
  16. tty-handler.c
  17. util.c
README.md

To Build

Note: In addition to a toolchain and autoconf tools, this requires autotools-archive to be installed.

To build this project, run the following shell commands:

./bootstrap.sh
./configure ${CONFIGURE_FLAGS}
make

To fully clean the repository, run:

./bootstrap.sh clean

To Run Server

Running the server requires a serial port (e.g. /dev/ttyS0):

touch obmc-console.conf
./obmc-console-server --config obmc-console.conf ttyS0

To Connect Client

To connect to the server, simply run the client:

./obmc-console-client

To disconnect the client, use the standard ~. combination.