#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Europe
    Posts
    21
    Rep Power
    0

    Exclamation Python UDP problem


    I am making a network program in Python. Everything was working fine until i tried to send a file.

    Now here is the problem:

    Code:
    for x in packets:
        s.sendto(x, (host, port))
    this wont work, it will send only 10 packets out of 16, it just stops, and i am like WTF? Then i tried to add a print line on the server end of the program as a trouble shooting line:

    Code:
    for x in packets:
        print "."
        s.sendto(x, (host, port))
    and works perfectly!!!!

    can a print line make such a difference?

    Another thing is that this also works fine:

    Code:
    for x in packets:
        time.sleep(0.001)
        s.sendto(x, (host, port))
    I dont want to print something for every packet i send!! any suggestions??
    (no there are no errors plus i double checked the hidden characters in notepad++ and everything is fine)
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Location
    39N 104.28W
    Posts
    157
    Rep Power
    2
    It seems like your channel is blocked. That is, your outgoing packets are backed up probably due to the channel connection. Why doesn't the sleep option solve the problem?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Europe
    Posts
    21
    Rep Power
    0
    Originally Posted by rrashkin
    It seems like your channel is blocked. That is, your outgoing packets are backed up probably due to the channel connection. Why doesn't the sleep option solve the problem?
    so you basically say that there is a burst of packets and it working like a denial of service attack so the socket/port drops some of the packets? (even if i apply it on the loop-back address 127.0.0.1)

IMN logo majestic logo threadwatch logo seochat tools logo