X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fio.h;h=4db04cf2594753769161b6881ad082a0ca13c0d9;hb=0438f2fc5df337e4264103a86c1765ace9c6565a;hp=10851d388a247b8cda7a23144b488c369ab16c01;hpb=dd9d65ee727ac7e95801da0f8b5bae7009811802;p=plomrogue diff --git a/src/client/io.h b/src/client/io.h index 10851d3..4db04cf 100644 --- a/src/client/io.h +++ b/src/client/io.h @@ -9,18 +9,23 @@ -/* Try sending "msg" to the server by writing it to the file at - * world.path_server_in. Try to open it 2^16 times before giving up. After - * opening, try to write to it 2^16 times before giving up. +/* Write "msg" plus newline to server input file at world.path_server_in. + * + * "msg" must fit into size defined by PIPE_BUF so that no race conditiosn + * arise by many clients writing to the file in parallel. */ -extern void try_send(char * msg); - -/* Keep checking for user input and a changed server out file. Update client's - * world representation on out file changes. Manipulate the client and send - * commands to server based on the user input as interpreted by the control.h - * library. On each change / activity, re-draw the windows with draw_all_wins(). - * When the loop ends regularly (due to the user sending a quit command), return - * an appropriate quit message to write to stdout when the client winds down. +extern void send(char * msg); + +/* Keep checking for user input, a changed worldstate file and the server's + * wakefulness. Update client's world representation on worldstate file changes. + * Manipulate the client and send commands to server based on the user input as + * interpreted by the control.h library. + * + * On each change / activity, re-draw the windows with draw_all_wins(). When the + * loop ends regularly (due to the user sending a quit command), return an + * appropriate quit message to write to stdout when the client winds down. Call + * reset_windows() on receiving a SIGWINCH. Abort on assumed server death if the + * server's out file does not get updated, even on PING requests. */ extern char * io_loop();