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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:40:18+00:00 2026-05-22T22:40:18+00:00

I have a tcp socket on which I receive video stream. I want to

  • 0

I have a tcp socket on which I receive video stream. I want to receive data as packet by packet from socket so that I could remove the packet header and keep the only stream data. How can I do this??

any help will be appreciated.

  • 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-22T22:40:18+00:00Added an answer on May 22, 2026 at 10:40 pm

    You can’t. TCP doesn’t work with packets / messages etc. TCP works with bytes. You get a stream of bytes. The problem is that there’s no guarantee reagarding the number of bytes you’ll get each time you read from a socket. The usual way to handle this:

    • When you want to send a “packet” include as the first thing a length
    • When you read stuff from a socket make sure you read at least that length

    Your message could be:

    |Message Length:4bytes|Additional header Information:whatever1|Message Data:whatever2|
    

    What you’ll then have to do is read 4 bytes and then read as much as those 4 bytes tell you. Then you’ll be able to strip the header and get the data.

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

Sidebar

Related Questions

Assume that i have created a client TCP Socket in Activity A. I want
I have developed a Java server using Eclipse that accepts TCP socket connection from
i have a TCP server which receives requests from clients. i want to make
I have a linux C program that handles request sent to a TCP socket
My situation is this : I have a C# tcp socket through which I
I have a client-server application which communicates over TCP/IP. I use System.Net.Sockets.Socket type object
I have a worker thread that is listening to a TCP socket for incoming
I have a method which receives a file over a TCP socket using this
I have a c# socket based server which serves TCP clients. I use telnet
I have a java server which is using TCP and sockets to connect 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.