Re: How to close a blocked socket



Thank you. I did that and it seems to work now.

--

Regards,

Diego F.


"brianlanning" <brianlanning@xxxxxxxxx> wrote in message
news:1183036226.914825.10450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 28, 7:12 am, "Diego F." <diego_f...@xxxxxxx> wrote:
Hello. I don't know how to force the closing of a blocked socket.

I have an server application that listens to a port. It works as it is
very
simple, but I'm not sure about how to close the socket.

I use a thread to run the socket part, so I don't block the user
interface.
If I close the application, and open again, the port is still in use.

I try to suspend the thread, but it doesn't work also.

How can I do that?

When you created the thread that manages the socket, did you set the
IsBackground flag to true? If you do that, the OS will terminate your
child threads when the main application closes.

http://msdn2.microsoft.com/en-us/library/system.threading.thread.isbackground.aspx

brian



.



Relevant Pages

  • RE: call is blocked in recvfrom() and no further proceedings in Win CE
    ... In windows CE, I'm able to send a request but I'm unable to receive it. ... Create another socket & bind with server IP address. ... > My program has to send request to service through port 5070(in this port only ...
    (microsoft.public.windowsce.embedded)
  • Re: Socket, Broadcast et fileevent ?
    ... I slightly modified the IO-Multiplexed Server so that each client's ... # Perl socket stuff is based on, and very similar to, C socket stuff. ... # Use port addresses in the range 5000-6000 for the assignments. ... # When a new connection is established, ...
    (comp.lang.perl.tk)
  • Re: Definition of a socket on Suns website
    ... the server gets a new socket bound to a different port. ... It needs a new socket (and consequently a different port number) so that it can continue to listen to the original socket for connection requests while tending to the needs of the connected client. ...
    (comp.lang.java.programmer)
  • Re: socket communication: socket doesnt connect
    ... Microsoft MVP, MCSD ... As far as your server code goes, ... accept the listening socket. ... overlapped sockets with an I/O Completion Port. ...
    (microsoft.public.vc.language)
  • Re: millionth socket problem....
    ... > my client *is* working. ... > My server is the following, ... > use Socket; ... Your program worked for me, if I changed the port number to 7023, as ...
    (perl.beginners)