Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6144033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:35:52+00:00 2026-05-23T18:35:52+00:00

im implementing a tcp/ip service in c++. what happen is that the server will

  • 0

im implementing a tcp/ip service in c++. what happen is that the server will receive data and each data may contain 1 or more messages. the server is only allow to receive a max of e.g 100 bytes of data per round. so in scenario 1, if a message is of 120 bytes, it will be split into 2 data. so i create a global static char tmpbuffer[100] temporary. upon receviving the data, i check the msg header for the total message size. if its more than 100 bytes, i store the first 100 bytes into tmpbuffer. it will wait for the 2nd loop where the next 100 bytes of data will come.this 100 bytes will contain the remaining 20 bytes which i wanna concat to the tmpbuffer.

however the problem here is that tmpbuffer size increases dynamically. lets assume that this function will cater for messages much bigger than just 120 bytes. it could be 1000 bytes, thus the message will be split into 10 data each of 100 bytes. by using char only, can i increase the tmpbuffer size dynamically? that means gloablly i set,
static tmpbuffer[100]. in the function, once i know the total message size from the msg header, how can i increase the tmpbuffer size.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:35:52+00:00Added an answer on May 23, 2026 at 6:35 pm

    Use a std::vector instead. Will save you soooo much hassle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing a java TCP/IP Server using ServerSocket to accept messages from clients via
I am looking for any strategies people use when implementing server applications that service
I'm implementing a TCP socket server in C and Linux. It will be a
I am planning on implementing a special purpose TCP server in C on Linux.
Can anyone propose good design idea for implementing Client for processing messages from TCP/IP.Messages
Implementing a web service that uses Transport-level security with WCF over HTTP is pretty
I am implementing a TCP Server in Erlang which talks to mobile phone clients.
I'm implementing a simple TCP client and TCP server in Java at the moment,
I've written a TCP server in node.js implementing a binary protocol. Using buffers this
I have a java server that has to communicate over a TCP socket to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.