martedì 4 ottobre 2016

Day 171: Send and Receive

Today I implemented TCP communication between the server and client process.
Now they both have a send and a receive function. Right now you don't have access to any advanced feature of TCP to make things very simple and userfriendly. I'll add those when (and if) they'll be needed.
Upon reception of a message TCP doesn't know its size, and to solve the problem I adopted a very simple solution, which is probably not the most optimized, but I don't care because I'll use TCP only for slow and reliable connections. Tomorrow I'll probably implement UDP, and that's where I'll try to squeeze every extra bit of performance I can.

In the screenshot the client is sending to the server an "hello" message after the other, which is then read and printed on server side.


Nessun commento:

Posta un commento