Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Transmission of Video File

Transmission of Video File

Scheduled Pinned Locked Moved C#
helpsysadmintutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DeepOceans
    wrote on last edited by
    #1

    Hi, I'm transmitting recorded video file over LAN using UDP but sometimes file transmit successfully and sometimes at receiving side(client) it doesn't receive properly whereas at server side I get transmitting message. Please See my code and give me suggestion to overcome this problem. public void filercvold() { outStream = File.OpenWrite(filepath); bufOutStream = new BufferedStream(outStream); i=0; while (i<=fsize)//fsize is filesize { try { idsock.ReceiveFrom(rcvfilebuf, ref idep); bufOutStream.Write(rcvfilebuf, 0, rcvfilebuf.Length); i++; } catch (SocketException ttt) { MessageBox.Show(ttt.Message); } } bufOutStream.Flush(); bufOutStream.Close(); outStream.Close(); MessageBox.Show("File is completly received!!"); } //outStream is FileStream Object //bufOutStream is BufferedStream Object idsock is socket object // rcvfilebuf = new byte[16384]; 16KB packet Now whenever I got last msg "File is completly received" File fully saved and run properly. but when I dont get this msg as at server side I got transmitting msg but at same time at client side above notification doesn't show as client become stuck or remain in this statement " ReceiveFrom(rcvfilebuf, ref idep);" Now tell me how to check this or rcv full video every time as it doesnt happen everytime.By same code I got this msg and run video file at client but by same code above problem I face so what is main reason or where I'm doing wrong. Thanx in advance. Regards,

    Shanzay

    realJSOPR 1 Reply Last reply
    0
    • D DeepOceans

      Hi, I'm transmitting recorded video file over LAN using UDP but sometimes file transmit successfully and sometimes at receiving side(client) it doesn't receive properly whereas at server side I get transmitting message. Please See my code and give me suggestion to overcome this problem. public void filercvold() { outStream = File.OpenWrite(filepath); bufOutStream = new BufferedStream(outStream); i=0; while (i<=fsize)//fsize is filesize { try { idsock.ReceiveFrom(rcvfilebuf, ref idep); bufOutStream.Write(rcvfilebuf, 0, rcvfilebuf.Length); i++; } catch (SocketException ttt) { MessageBox.Show(ttt.Message); } } bufOutStream.Flush(); bufOutStream.Close(); outStream.Close(); MessageBox.Show("File is completly received!!"); } //outStream is FileStream Object //bufOutStream is BufferedStream Object idsock is socket object // rcvfilebuf = new byte[16384]; 16KB packet Now whenever I got last msg "File is completly received" File fully saved and run properly. but when I dont get this msg as at server side I got transmitting msg but at same time at client side above notification doesn't show as client become stuck or remain in this statement " ReceiveFrom(rcvfilebuf, ref idep);" Now tell me how to check this or rcv full video every time as it doesnt happen everytime.By same code I got this msg and run video file at client but by same code above problem I face so what is main reason or where I'm doing wrong. Thanx in advance. Regards,

      Shanzay

      realJSOPR Offline
      realJSOPR Offline
      realJSOP
      wrote on last edited by
      #2

      Without seeing all of the related code, we probably can't help you.

      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
      -----
      "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups