Yes. Anything going beyond 2048 in your current code will be a buffer overflow - I thought you were studying that so that you could avoid it? Obviously didn't work.
Second, why not do:
Also, unless you also put a zero at the end of the receiving buffer and have enough space to receive ALL of the message, strlen() on the receiving side will continue until it finds a zero. Consider this:
message = 0;
memset(message, '!', 2048);
// Optionally printf strlen(message).
If you now recieve 1024 '!', then the message will contain 18975 '$', then a zero - so strlen is 20000. In your case, if you transmit 1024 or more bytes, strlen() will go outside the buffer.
memset(message, '$', sizeof(message)-1);
message[sizeof(message)-1] = 0;
recv(acceptsock, message, 1024, 0);
printf("Message len = %d\n", strlen(message));