Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Oct : Very strange error.
| Subject: | Very strange error. |
| Posted by: | "Olivier Pons" (olivier.pons@f.r.e.e.fr.remove.unnecessary.dots.com) |
| Date: | Thu, 20 Oct 2005 20:21:48 |
I have a thread. The main thread.
I use it as a server. I use overlapped and completion ports winsock
functions.
Everything works fine (works perfectly to be clear).
If i try to cut & paste the main infinite loop (wait for a client to
connect, then accept it) into another empty procedure and *just* call this
procedure, when I call WSAAccept() in it there's an error !
WSAGetLastError returns (I translate, I'm sorry I'm French) :
"the system has detected a non valid pointer address when trying to use a
pointer argument in a procedure call".
There's no pointer at all :
NewSocketClient := WSAAccept(FSocketListen, InternetAddr, nil, nil, 0);
with
FSocketListen : TSocket;
NewSocketClient : TSocket;
InternetAddr : TSockAddrIn;
This is so weird ! I'm stuck.
Any idea ?