Quick Search for:  in language:    
10049,want,know,control,error,from,TClientSoc
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Delphi Stats

 Code: 209,911. lines
 Jobs: 14. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for Delphi.
Record From Microphone to Wave File
By Una-Rat on 11/25


List Manager
By james hill on 11/17


Click here to see a screenshot of this code!Skin app
By Jonathan Curry on 11/15

(Screen Shot)

Click here to see a screenshot of this code!Encrypted Notepad
By Kresnata Adijaya on 11/15

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

TClientSocket errors

Print
Email
 

Submitted on: 8/18/2003 11:01:49 AM
By: Adrian Cristea 
Level: Beginner
User Rating: Unrated
Compatibility:Delphi 7, Delphi 6, Delphi 5

Users have accessed this article 1443 times.
 
 
     I want to know how to control an error from TClientSocket! I set socketerror to 0 (zero) but when my program does a reconection: Windows socket error on api connect (10049)! How can I control it? Please help me...

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Hello world! I need your help again... I am a beginner... K... My problem is that of using sockets. I made a program that use sockets (TClientSocket) in Delphi7. It worket very fine on localhost(disconnected from the net)! Client.host:='localhost'; Client.port:='1034'; SocketError:=0 (no errors!); I set this: on error reconnect and on disconnect reconect again and on load form connect! It worket fine! But when I set client.host to 'www.yahoo.com' or another server errors apears on display (notice that socketerror:=0)! Why? Error: Windows socket error (10049) on api connect! How can I control this errors? Please tell me how to control this... I need it... Thanks!


Other 3 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
8/18/2003 2:15:13 PM:Aseerha
I didnt really get you, but I'll try my best. If you want to handle that error, type: try client.blabblbla; client.an otherblabla; except showmessage ('This error occured'); end; This will raise a messagebox when an error occurs... :) Delphi7's debugger might stop the execution, but if compile it and run it, it will handle the error.. :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/18/2003 6:27:44 PM:
I know what your talking about I sometime have the same issue, & usually even a TRY EXCEPT statement wont work, it would be possible to make a custom exception hidden dialog/log to handle any exceptions This is what i used for one of my projects, may be of help or not ;) - Case ErrorCode of 10049: ClientSocket1.Open; 11004: Log('Server Not Found, Check Connection'); 10022: Log('Sync Cancel Request'); Else Log('Error ' + IntToStr(ErrorCode)); End; Errorcode := 0;
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/19/2003 12:43:42 AM:
Thanks man... My project works fine right now! Thanks again...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/22/2003 4:55:21 AM:
I've a further question, maybe it looks foolish-): Where I should put the" Case ErrorCode of 10049: ClientSocket1.Open; 11004: Log('Server Not Found, Check Connection'); 10022: Log('Sync Cancel Request'); Else Log('Error ' + IntToStr(ErrorCode)); End; Errorcode := 0;"
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Delphi Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.