C ++ network stream

I'm a newbie using C ++ and I have a background with Java

I am working on a simple Linux server using C ++, and I have a question about converting byte data.

In Java, I can use putShort or putString in ByteBuffer and just send the buffer through the socket using byteBuffer.array ()

What is the appropriate C ++ code of this?

Thanks in advance.

+3
source share
2 answers

C ++ itself does not have an embedded network. You might want to slip through formatting libraries . Install them, they are common, and read the documentation.

+2
source

All Articles