How to make socket chat in C++?

五迷三道 提交于 2019-12-13 09:55:10

问题


Does anybody know how to make socket chat in C++ using something like sockets in Java? Is there any way to make ip chat in C++?


回答1:


yes it is possible. You could use a library like Boos.Asio which has an example of chat in its documentation : http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/chat/posix_chat_client.cpp (client part)




回答2:


Yes to both of your questions. The program would work exactly the same in C++ as it does in Java. You listen on a host/port and send to a host/port. The only difference will be the language and the API used.



来源:https://stackoverflow.com/questions/6820633/how-to-make-socket-chat-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!