Delphi Indy Socket Error 10061
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions asynchronous socket error 10061 delphi you might have Meta Discuss the workings and policies of
Socket Error 10061 Connection Refused Delphi
this site About Us Learn more about Stack Overflow the company Business Learn more about hiring delphi indy socket example developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is socket error 10061 windows live mail a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Indy Dynamic Create Server Client connecting error 10061 up vote 0 down vote favorite I am having trouble dynamically creating some INDY communication. I have not used Indy before and I can't
Socket Error 10061 Connection Is Forcefully Rejected (server)
get the server set up right. I get the error 10061. I have added a rule to the fire wall to allow this application and the port. It works if I use TServerSocket and TClientSocket but I need to use Indy. This code does not work procedure TForm3.Button3Click(Sender: TObject); var temp : TIdSocketHandles; begin fIdTCPServer1 := TIdTCPServer.Create(nil); fIdTCPClient1 := TIdTCPClient.Create(nil); temp := TIdSocketHandles.Create(fIdTCPServer1); temp.Add.IP := 'xxx.xx.xxx.xx';//'localhost'; //gave error when tryingn to use local host temp.Add.Port := 20200; fIdTCPServer1.Bindings := temp; fIdTCPServer1.OnExecute := IdTCPServer1Execute; fIdTCPServer1.StartListening(); fIdTCPClient1.Port := 20200; fIdTCPClient1.Host := 'xxx.xx.xxx.xx';//'localhost'; fIdTCPClient1.Connect; //error 10061 here fIdTCPClient1.IOHandler.WriteLn('Some message'); end; procedure TForm3.IdTCPServer1Execute(AContext: TIdContext); var inStr : String; begin inStr := AContext.Connection.IOHandler.ReadLn; ShowMessage('Server received : ' + inStr); end; This code works procedure TForm3.Button1Click(Sender: TObject); begin serverSocket1 := TServerSocket.Create(nil); clientSocket1 := TClientSocket.Create(nil); serverSocket1.Port := 20200; serverSocket1.OnClientRead := ServerSocket1ClientRead; serverSocket1.Active := True; clientSocket1.Port := 20200; clientSocket1.Host := 'localhost'; clientSocket1.Active := True; clientSocket1.Socket.SendText('Some message'); end; procedure TForm3.ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket); var inS
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business socket error 10061 outlook express Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation socket error 10061 connection refused smtp Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like
Socket Error 10061 Connection Refused Windows 7
you, helping each other. Join them; it only takes a minute: Sign up Socket Error while making tcp ip connection in delphi up vote 2 down vote favorite I am using indy client to make tcp ip http://stackoverflow.com/questions/19283701/indy-dynamic-create-server-client-connecting-error-10061 connection with a server(IP address and port). I have written following code on the click of a button. I trying to send Hello msg to server and then trying to read the message from server. procedure TForm1.Button1Click(Sender: TObject); var sMsg : string; begin try IdTCPClient1.Port := xxxx; //Set port to connect to IdTCPClient1.Host := 'xxx.xxx.x.xxxx'; //Set host to connect to IdTCPClient1.Connect; //Make connection sMsg := IdTCPClient1.Socket.ReadLn; //Read the response from the server ShowMessage(sMsg); except on http://stackoverflow.com/questions/13448429/socket-error-while-making-tcp-ip-connection-in-delphi E : Exception do begin ShowMessage('Connection Error: ' + E.Message); exit; end; end; end; But I am getting socket error 10061 connection refused while debugging at the line IdTCPClient1.Connect; //Make connection I tried to make tcp connection with server on given port and ip using telnet command on cmd (telnet ip port) and I got the following message "Connection established to xxx.xxx.xx.xxx, there could be no connection made with the host, on port xxxx: connection errors" Please suggest me the solution for this... Thanks all. Now I am able to use the port. So no error at IdTCPClient1.Connect; //Make connection. But now nothing is happening at the next line where I am trying to read data from the server (sMsg := IdTCPClient1.Socket.ReadLn;) When I try from telnet, some miscellaneous characters are read from server. What could be the reason for this? delphi sockets networking tcp delphi-xe2 share|improve this question edited Nov 20 '12 at 7:19 asked Nov 19 '12 at 5:57 user1556433 2 Is there actually a program running on the server that listens to the specific port? Also, have you checked that there is no firewall stopping you? –Joachim Pileborg Nov 19 '12 at 8:47 I have ensured that program is running on server that listens to that port. How should I confirm whether firewall is blocking or not? &nd
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring http://stackoverflow.com/questions/5005607/is-indy-tidtcpclient-suitable-for-local-tcp-ip-connections developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask http://www.delphigroups.info/2/9/213512.html Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Is Indy TIdTCPClient suitable for local TCP/IP connections? up vote 0 down vote favorite I need to connect to a device on the local network, using a TCP/IP connection. When I socket error use a TIdTCPClient, all works well, except one thing: If the connection is not available, it takes about 18-20 seconds before I get a timeout. The property ConnectTimeout has no effect, no matter what values I set. It always takes the same amount of time before a timeout. This answer mentions long delay times for a timeout, and I am wondering if that's related to the Indy components? I have to find out if the connection cannot be established socket error 10061 very quickly, let's say within 1 second at most. Is there a way to do this using Indy, or do I need to use different components / a different approach? (I'm using the Indy 10 version that shipped with Delphi 2009) EDIT: I followed the instructions to upgrade Indy to the latest version in this post. Still the same, it now consistently takes 22 seconds until TCPClient.Connect returns when there is no connection. ConnectTimeout and/or ReadTimeout seem to have no influence on this. delphi delphi-2009 indy indy10 share|improve this question edited Feb 16 '11 at 13:14 asked Feb 15 '11 at 15:27 Holgerwa 1,89822945 If you want a quick non-blocking delphi socket solution, try ICS - overbyte.be/frame_index.html –Warren P Feb 16 '11 at 2:43 What error do you get? –Misha Feb 16 '11 at 22:13 @Misha: I get a connection timeout, as expected, but I cannot wait 20 seconds for this to happen. If there is a connection problem, I need to know right away. –Holgerwa Feb 17 '11 at 8:01 Are you using an IP address or a host name? Could this be a DNS host name resolution issue? –Misha Feb 17 '11 at 11:28 @Misha: I'm using the IP address of a device on the same LAN. No name resolving. –Holgerwa Feb 17 '11 at 12:18 add a comment| 3 Answers 3 act
an e-mail from a program compiled with Delphi 2006 and indy 10 This is the code: //setup SMTP SMTP.Host := MailHost SMTP.Port := 25; //setup mail message MailMessage.From.Address := FromAddress MailMessage.Recipients.EMailAddresses := edDestinatario.Text;; MailMessage.Subject := edOggetto.Text; MailMessage.Body.Text := meMessaggio.Text; //send mail try try SMTP.Disconnect; SMTP.Connect(SMTP.Host, 1000); ---- socket error what's wrong? thank you for helping me Franz Michael Fullerton Delphi Developer 2007-01-24 03:51:38 AM Re:tidSMTP Socket Error 10061 while sending e-mail "Franz"