Two-way communication in socket programming using C

后端 未结 5 1909
失恋的感觉
失恋的感觉 2020-12-17 17:32

I have a small doubt in socket programming. i am able to send my data from client to server and my server processes the data. The o/p of the data processed, I want to send b

5条回答
  •  遥遥无期
    2020-12-17 18:02

    (Late answer, so mainly for anyone else who comes here looking for help)

    I recently put up an example client/server application that closely follows Beej's Guide to Network Programming (which was also recommended by Kerrek SB in his answer). If you're looking for a simple working example of client/server communication, maybe this will help:

    https://github.com/countvajhula/dummyclientserver

    In particular, no, your client does not need to set up a separate listening socket to receive data from the server -- after the server has accepted the connection from the client, the server can simply send data back to the client on the same socket.

提交回复
热议问题