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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:12:36+00:00 2026-06-06T13:12:36+00:00

I have developed the following C code to mask data before sending back to

  • 0

I have developed the following C code to mask data before sending back to web server client which is java script running on Firefox browser using RFC 6455 Protocol.
However I am facing problem as I am not able to see anything on client side.
Some say that its not necessary to mask data when sending from server to client. Is that true ? I can’t see that working in my case.
Let me know if my question is ambiguous somewhere.
Thanks for your kind help.

char frame[131],message[360];
strcpy(message,"Server here !");                
frame[0] = '\x81';
frame[1] = 128 + strlen(message);
frame[2] = '\x00';
frame[3] = '\x00';
frame[4] = '\x00';
frame[5] = '\x00';
snprintf(frame+6, 124, "%s", message);
printf("%s", frame);
n = write(newsockfd, frame, strlen(frame));
  • 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-06T13:12:38+00:00Added an answer on June 6, 2026 at 1:12 pm

    Do not use the strlen function to get the length of anything but a C-style string. Your frame is not a C-style string. The length of the frame is 6 + strlen(message), not strlen(frame).

    This is also why printf("%s", frame); didn’t work. The %s format specifier is for C-style strings, which your frame isn’t.

    This assumes your message is a C-style string. If not, you have other bugs since you use strlen to compute its length in the initializer for frame[1].

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

Sidebar

Related Questions

In a JSF 2 application, which is developed on tomcat, I have the following
I have developed a web service and host it on my server and I
I developed a C++ program which utilises an .exe file through the following code:
I have developed an web application using JSP and deployed in tomcat server. In
I have developed a JSP web application which, on every request, spawns a new
I have developed a client application to consume a web service, there are no
I have developed a Client/Server application for my current employer and one of the
I have developed a VB.NET WCF service that recives and sends back data. When
I have developed a rest web service by using the following link http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx Now,
I have developed a generic producer-consumer queue which pulses by Monitor in the following

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.