It appears that because the database requests are serviced so quickly Winsock is somehow becoming flooded(?) and the WSAGetLastError returns WSAEWOULDBLOCK. in the server-side, make sure that you send to the socket by index, example: ServerSocket1.Socket.Connections[SocketIndex].SendText(); Don't forget the .Connections property. Join & Ask a Question Need Help in Real-Time? You will need to wait until IPPort.GetConnected() returns TRUE before calling SetDataToSend. Source
BTW, The sockets always check that they are connected before sending anything and connect if necessary.. Covered by US Patent. Thanks Steve 0 Question by:steve-west Facebook Twitter LinkedIn Google LVL 28 Best Solution byciuly I don't get it. basically, you need to modify the thread os that i gets to do oprations an dnot just one operation. http://stackoverflow.com/questions/13331049/delphi-socket-error
once the thread is create and teh socket is created, you only need to use it. Gooije Delphi Developer Thu, 11 Dec 2003 22:35:04 GMT Re:Error 10057 WSAENOTCONN (10057) Socket is not connected. Is there a better solution to the one that I've come up with?
Is there a better solution to the one that I've come up with? TNMHTTP - Socket is not connected 10. and you can get faster help also ciuly View Public Profile Send a private message to ciuly Visit ciuly's homepage! It may not be initialized.
PaHaNjkee Посмотреть профиль Найти ещё сообщения от PaHaNjkee 16.03.2014, 12:30 #6 PaHaNjkee Delphi 10 Seattle Форумчанин Регистрация: 01.11.2010 Сообщений: 74 Репутация: 16 skype: pahanjkee Код: ServerSocket1.Socket.Connections.SendText(...); Помогло, спасибо, Password Lost Password? in that code: - if the socket is already in wsconnecting, calling sendstr will leave it that way so wsagetlasterror after the sendstr will read it in and will sleep on Date Entered: 02/29/2000 Last Updated: 06/07/2004 Please make sure that you are not sending data before the connection had been made.
This did not work at all - WSAEWOULDBLOCK was always being returned so the socket just sat there... 0 LVL 28 Overall: Level 28 Pascal 6 TCP/IP 1 Message Accepted http://www.programmersforum.ru/showthread.php?t=256788 the only porblem you will need to take into account is while the thread runs, what are the chances of the DB getting out of that default state in which it now, you say that you get an error. This means you tried to read the RemoteAddress property of a Socket that was no longer connected to the server.
Find all posts by NeiSep Page 1 of 2 1 2 > « Previous Thread | Next Thread » Thread Tools Show Printable Version Email this Page Display Modes Linear Mode this contact form PaHaNjkee Посмотреть профиль Найти ещё сообщения от PaHaNjkee 16.03.2014, 12:18 #4 Stilet Белик Виталий :) Профессионал Регистрация: 23.07.2007 Адрес: Украина, Донецкая область, г. Краматорск Сообщений: 57,986 Репутация: 6762 I made a simple chat programm but after client sends first message this error apperas (it happens during sending - just after server get's the message ) Windows socket error: Р—Р°РїСЂРѕСЃ Windows socket error (10049) on API connect Board index » delphi » 10057: Socket error, not connected Chin Wu Delphi Developer Wed, 02 Jul 2003 22:46:11 GMT 10057: Socket error,
but it si possible. What I have found is that after X (random amount but usually more than 10), the socket state changes from wsConnected to wsConnecting. there is one aspect which is not clear to me: - the DB is beeing put in that default state every single time a soket is created and then taken out have a peek here Connect with top rated Experts 14 Experts available now in Live!
Why do dealers in Vegas check ID even if I look older than 25? Arie Delphi Developer Fri, 12 Dec 2003 06:20:50 GMT Re:Error 10057 maybe the server that u are trying to connect limits u to 42 connection at a time. It has a separate list of pending requests and as a thread terminates, a pending request is taken from the queue and a thread created to execute it.
HTML код Выкл. Here's client code unit Client; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ScktComp, StdCtrls; type TForm1 = class(TForm) lblHost: TLabel; edtHost: TEdit; lblPort: TLabel; edtPort: TEdit; btnConnect: Don't know what else to try. This may be because the general activity of this application is much greater (although socket activity per thread is much less), though I'm not sure.
Altering of the Delphi code isn't the issue, it's the database side of things which I don't even want to go near for risk of inducing error into our other applications share|improve this answer edited Apr 26 at 8:50 answered Mar 13 '13 at 9:05 user1803300 add a comment| up vote 0 down vote Error code 10057 is WSAENOTCONN, and getpeername() is Socket.Connected not made false after closing socket 6. Check This Out if this is true, then before each job you will have to chheck if ythe socket is connected or not, and connect it if it's not. (this sould also be a
Register FAQ Community Calendar Today's Posts Search Community Links Members List Search Forums Show Threads Show Posts Tag Search Advanced Search Go to Page... In the case of this application , it does make sense to re-use the thread objects, but this is not going to be five minutes work. if so, what am I missing? 0 Message Author Comment by:steve-west2008-03-04 I read that article as well before making the post.