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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:46:54+00:00 2026-05-26T09:46:54+00:00

I am creating a program similar to Microsoft Netmeeting for that I have to

  • 0

I am creating a program similar to Microsoft Netmeeting for that I have to send Multiple type of data from a single connection such as Mouse position, Pressed key and offcourse a screen shot at a time. I am success fully sending and receiving Screen shot to the client but I am unable to understand how multiple data could be send through the single connetion.

I think it require multiple ports for this purpose. One for Screen shot, One for Mouse Pos and One for Key pressed.

Following are the codes I am using:
Server = Sender of ScreenShot, Recever of MousePos and Key.
Client = Receiver of ScreenShot, Sender of MousePos and Key.

Server:

void StartListen()
{
    try
    {
        IPEndPoint ipendp = new IPEndPoint(IPAddress.Parse(OwnIP()), 532);
        tcpl = new TcpListener(ipendp);
        tcpl.Start();
        s1 = tcpl.AcceptSocket();
        ns = new NetworkStream(s1);
        timer1.Enabled = true;
        while (true)
        {
            byte[] buffer = imageToByteArray(CaptureScreenShot());
            s1.Send(buffer, buffer.Length, SocketFlags.None);
            Thread.Sleep(250);
        }
    }
    catch
    {
        tcpl.Stop();
        ns.Close();
        //tcpl.EndAcceptSocket();
        Form1_Load(0,EventArgs.Empty);
    }
}

Client:

void StartClient()
{
    try
    {

        IPEndPoint ipendp = new IPEndPoint(IPAddress.Parse(toolStripTextBox1.Text), 532);
        this.Text = "SWare Application - " + toolStripTextBox1.Text + ":532";
        tcpc = new TcpClient();
        tcpc.Connect(ipendp);
        Socket s1 = tcpc.Client;
        ns = tcpc.GetStream();

        while (true)
        {
            byte[] b = new byte[500000];
            s1.Receive(b);
            MemoryStream ms = new MemoryStream(b);
            pictureBox1.Image = Image.FromStream(ms);
            //Thread.Sleep(250);
        }
    }
    catch
    {
        tcpc.Close();
        MessageBox.Show("Disconnected from the Remote PC");
    }
}
  • 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-26T09:46:55+00:00Added an answer on May 26, 2026 at 9:46 am

    You can use a single connection, but you have to provide a way for the receiver to differentiate the type of data (and its size) prior to reading it.

    That being said, if you’re writing both sides of the connection (the client + server), it would be far simpler to use a technology like WCF. It would allow you to pass full class instances with strongly typed data, and take care of the underlying transport (in a configurable way) for you automatically.

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

Sidebar

Related Questions

I have a C++ program that will read in data from a binary file
I'm creating a program that authenticates from a before it runs. I also want
I have made a program in Flex for creating simple schedules, similar to MS
I have a program that downloads a binary file, from another PC. I also
I have a program that is creating an ItemizedOverlay and a map. Everything works
I am creating a program that will download a .jar (java) file from a
Okay, I'm creating a program from a single class, let's call it John class.
I creating a program which send newsletter with a background image. It works fine
I'm creating a program using C# (in ASP.NET environment) that makes an XML file.
I am currently creating a program that dynamically adds Image to a dockPanel every

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.