Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: Thread, blocking socket
| Subject: | Re: Thread, blocking socket |
| Posted by: | "Richard Carpenter" (richar..@richardj.demon.co.uk) |
| Date: | Sat, 30 Dec 2006 22:57:33 |
> I guess what you observe is simply Delphi's debugger behaviour.
> ( I assume you have breakpoint on the RecvFrom call or some such)
>
> - ReadData() uses a socket, blocks on RcvFrom(), and runs in the thread's
> context;
> - Each call to SendData() creates a *new* socket, broadcasts the data,
> closes the socket, but runs in the *main* thread's context, not in the
> thread's context as I suspect you are assuming.
> -Both sockets are unrelated, as long as there no port conflicts.
>
> IOW, this should work...
>
> --
> Dirk.
> No trees were killed in the creation of this message;
> however, many electrons were terribly inconvenienced.
> http://users.pandora.be/dirk.claessens2
>
>
Hi Dirk,
That certainly clarifies it - thank you. I had, wrongly, assumed that it was
the thread performing the SendData when, as you pointed out, it's the main
thread doing the work.
Should I be worried about my main thread "dipping" into a method of the
thread object - even though the thread object never uses the method?
Many thanks, much appreciated
Regards
Richard