TcpClient myclient; MemoryStream ms; NetworkStream myns; BinaryWriter mysw; Thread myth; TcpListener mytcpl; Socket mysocket; NetworkStream ns; private void Start_Receiving_Video_Conference() { try { // Open The Port mytcpl = new TcpListener(5000); mytcpl.Start(); // Start Listening on That Port mysocket = mytcpl.AcceptSocket(); // Accept Any Request From Client and Start a Session ns = new NetworkStream(mysocket); // Receives The Binary Data From Port picture_comming.Image = Image.FromStream(ns); mytcpl.Stop(); // Close TCP Session if (mysocket.Connected == true) // Looping While Connected to Receive Another Message { while (true) { Start_Receiving_Video_Conference(); // Back to First Method } } myns.Flush(); } catch (Exception) { button1.Enabled = true; myth.Abort(); } } private void Start_Sending_Video_Conference(string remote_IP, int port_number) { try { ms = new MemoryStream();// Store it in Binary Array as Stream IDataObject data; Image bmap; // Copy image to clipboard SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0); // Get image from clipboard and convert it to a bitmap data = Clipboard.GetDataObject(); if (data.GetDataPresent(typeof(System.Drawing.Bitmap))) { bmap = ((Image)(data.GetData(typeof(System.Drawing.Bitmap)))); bmap.Save(ms, ImageFormat.Bmp); } picCapture.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] arrImage = ms.GetBuffer(); myclient = new TcpClient(remote_IP, port_number);//Connecting with server myns = myclient.GetStream(); mysw = new BinaryWriter(myns); mysw.Write(arrImage);//send the stream to above address ms.Flush(); mysw.Flush(); myns.Flush(); ms.Close(); mysw.Close(); myns.Close(); myclient.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Video Conference Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }