Results 1 to 5 of 5

Thread: [2008] sockets question

  1. #1

    Thread Starter
    Hyperactive Member imadthemad's Avatar
    Join Date
    May 2005
    Posts
    344

    [2008] sockets question

    this problem only occurs sometimes, but when it happens there is nothing i can do about it and it keeps happening

    sometimes after i send an http request request using a socket connection and then i call mysocket.recieve, the returned integer is 0, and keeps returning 0 (in other words no data is returned from the server!) but my socket remains connected and no timeout\error is thrown!

    anyone have any idea on how to handle this? should i set different socket options (i use internetwork, stream, and tcp)....
    should i resend the request header when that happens?

    please help,
    thanx in advance
    imadthemad
    Basketball-NBA Dream status - quit
    Programming-Next Bill Gates Dream status - quit
    Becoming a doctor dream - LIVING IT: Med 2\4

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2008] sockets question

    Are you absolutely sure that the HTTP request you sent was valid? The first thing that comes to mind is if you havent properly ended the request with 2 newlines, so the server is expecting more data from you before it begins sending a response. Could you show the snippet of code you're using to send/receive HTTP data?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member imadthemad's Avatar
    Join Date
    May 2005
    Posts
    344

    Re: [2008] sockets question

    it's some long code....it's actually coding for an http proxy i've been working on, whereby the download manager sends the request to my program and my program sends the request to the internet server...

    my program validates the request and logs it before sending so i know the requests are valid

    it's not the new lines at the end because i put in

    Do Until requestHeader.Contains(vbCrLf & vbCrLf)
    requestHeader = requestHeader & vbCrLf
    Loop

    and it's not the requests because like i said i log them they're clean...
    also my program works 80% of the time but when it doesn't it just won't work for an hour or so....

    could be my internet connection, but then again i've had other users complain of the problem too and also my internet is still working when this happens so i'm very much at loss :S
    Basketball-NBA Dream status - quit
    Programming-Next Bill Gates Dream status - quit
    Becoming a doctor dream - LIVING IT: Med 2\4

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2008] sockets question

    Well if you're 100% sure that the requests are valid, and you cant show any code nor an example request from when you dont get any response, I'm afraid theres not much I can help you with
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5

    Thread Starter
    Hyperactive Member imadthemad's Avatar
    Join Date
    May 2005
    Posts
    344

    Re: [2008] sockets question

    i've looked at my code again and again it's practically flawless...
    i even ran http analyzer to make sure my program is connecting and sending the requests to the right server address and the right port (80) and it is...

    i will try changing socketflags coz i've never used them before maybe i should look into them...

    if that doesnt work i will try asyncrecieve....
    Basketball-NBA Dream status - quit
    Programming-Next Bill Gates Dream status - quit
    Becoming a doctor dream - LIVING IT: Med 2\4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width