I dont know if it makes any sense but its kinda strange what i found.
From the client i send send(server, size, 8, 0); with the second arg: char* size.
On the server i recv(client, size, 8, 0); with the second arg: char size.
If i change the type to char* size on the server too, it stops working.
Its not that important but maybe someone had an idea why is that.