SocketStream messages doesn't send, and send after close socket. #4528
Unanswered
iliyafaramarzi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i'm working on poco library and i want to create a TCP based program something like chatroom. I have a Server and a Client. when i use SocketStream to send messages to the server it doesn't work at the moment and send messages after the socket is closed(flush() doesn't work). i test socket.shutdownSend() it work but just for a message and after that close the socket. what should i do? is it better to use sendBytes and recieveBytes or no?
my client Code:
`int main() {
string message;
StreamSocket socket;
SocketAddress address("127.0.0.1", 8080);
}`
mt server Code:
`int main() {
try {
ServerSocket serverSocket(8080);
cout << "Server started" << endl;
}`
Beta Was this translation helpful? Give feedback.
All reactions