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 6054539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:09:51+00:00 2026-05-23T08:09:51+00:00

I am completely new to socket programming and beginner-intermediate in c++. I have written

  • 0

I am completely new to socket programming and beginner-intermediate in c++.
I have written a code in c++ and also another application in java. The java program will get data from the c++ code which generates data in seconds. I am trying to use socket programming to transfer data between these two. I have found some code here: Socket programming tutorial. I am using the UDP java client from it. However, for the UDP server it only has the C code. I need to embed this code into my C++ app. therefore I need a c++ version of it. Can anyone help me with this? or give me a link that gives a tutorial on it. anyhow the C code is:udpserver.c

  • 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-23T08:09:52+00:00Added an answer on May 23, 2026 at 8:09 am

    You must declare addr_len as socklen_t, not int.


    That is, the first few lines in main should read something like:

    int sock;
    int bytes_read; // <- note how this is now on its own line!
    socklen_t addr_len; // <- and this too, with a different type.
    char recv_data[1024];
    

    … Leaving everything else as it were.

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

Sidebar

Related Questions

Iam just a beginner student socket programming.I tried a simple code from TCP/IP Sockets
I'm completely new to socket programming with C#, I'm trying to get two running
I am new to programming and I am confused about asynchronous socket programming. For
I have a TCP socket application where I have to read several types of
I have a java app that creates a socket to talk to a server
I have a java application that can be run as a JFrame or as
Completely new to asp.net mvc... completely new to web apps so bear with me...
I am completely new to ruby and I inherited a ruby system for a
I'm completely new to AIR but what I'm trying to do feels like it
I am completely new to LINQ in C#/.NET. I understand that I could use

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.