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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. P2P File transfers

P2P File transfers

Scheduled Pinned Locked Moved C#
csharpperformancehelptutorialquestion
3 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.
  • S Offline
    S Offline
    Sri harini
    wrote on last edited by
    #1

    Hi, I developed P2P file transfers application using C#.NET in PC its working fine , but in Windows Mobile 5.0 , the chunks downloading is not complete, after downloading 4 or 5 chunks(32kB), its stopping.How to speed up the application?.. Anybody have idea?please help me..

    S 1 Reply Last reply
    0
    • S Sri harini

      Hi, I developed P2P file transfers application using C#.NET in PC its working fine , but in Windows Mobile 5.0 , the chunks downloading is not complete, after downloading 4 or 5 chunks(32kB), its stopping.How to speed up the application?.. Anybody have idea?please help me..

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi Sri harini, being a bit more specific would be helpful. What kind of protocol are you using (TCP or UDP)? How do you buffer the chunks? How does it stop, with an exception? Maybe you should also post relevant parts of your code. Regards Sebastian

      S 1 Reply Last reply
      0
      • S SeMartens

        Hi Sri harini, being a bit more specific would be helpful. What kind of protocol are you using (TCP or UDP)? How do you buffer the chunks? How does it stop, with an exception? Maybe you should also post relevant parts of your code. Regards Sebastian

        S Offline
        S Offline
        Sri harini
        wrote on last edited by
        #3

        Hi Sebastian We are using the following code to Read data,using TCP protocol.How to set the receive timeout option in Windows Mobile.Bcoz its throwing exception when we use SetSocketOption Method. Please advise. public void ReadData() { Byte[] buffer=null; Socket s=null; int port = threadVars.port; int chunksize=threadVars.chunksize; int cid = threadVars.cid; int fileid = threadVars.fileid; string hash = threadVars.chnkhash; readlocked = false; s=new Socket( SocketAddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); s.Bind(new IPEndPoint(IPAddr, port)); s.Listen(1); Socket actualReader = s.Accept(); NetworkStream DataStream = new NetworkStream(actualReader); int offset = 0; int bytesActuallyRead = 0; int i=0; do { i = i++; bytesActuallyRead = DataStream.Read(buffer, offset, buffer.Length - offset); offset += bytesActuallyRead; if (bytesActuallyRead == 0) { break; } Thread.Sleep(10); } while(actualReader.Connected && i<1000); parentController.SocketReadComplete(false,cid, fileid, buffer,chunksize,hash); } DataStream.Flush(); DataStream.Close(); s.Close(); } Thanks Sri harini

        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