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

  • Home
  • SEARCH
  • 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 9075245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:49:29+00:00 2026-06-16T18:49:29+00:00

I have a simple server written in c# listening on some port. I have

  • 0

I have a simple server written in c# listening on some port. I have an application in c++ and I need the application to send some information to the server. This information is a struct containing 5 integers. I was thinking that I can send it also as a string: something like: “ID=3, anotherInt=5…”. Is it a good idea? If not, how should I do that?

How to make it work? What is your advice?

Thank you.

  • 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-06-16T18:49:30+00:00Added an answer on June 16, 2026 at 6:49 pm
    connect(client_socket, (struct sockaddr *)&clientService, sizeof(clientService));
    

    this is ok, but this line should read:

    send(client_socket,(const char*)ln, strlen(ln), 0);
    

    where the conversion (const char*) can be omitted.
    In your code the value of pointer ln is sent (correctly) but you most likely want to send the string it’s pointing to in it’s entire length.

    Concerning the messages to be send: Converting integers to ascii is not a bad idea. You also may have a look at JSON or Googles protobuf format. Formatters or Parsers can easily be written from scratch.

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

Sidebar

Related Questions

I have a very simple client server code written java(server listens on some port
I have written a simple web Application which is running(on Tomcat Server) fine on
I have written a simple c++ server/client chat application. I am interested in being
I have written a simple single threaded client server application in Visual C++ .
I have written a simple web application with embedded web server (tornado), database (sqlalchemy
I have a simple UDP client server written in C++ on Ubuntu 9.10 where
I have a written a very simple UDP Server using Netty - it quite
I have built a simple TCP server and need to compare client input with
I have written a simple Java application that interacts with multiple instances of itself
I have written a simple erlang app using gen_server. When starting it with application:start(myapp),

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.