Nonblocking connect
-
Hi everyone, I am trying to write a program which searches for a service on a network. I tries to connect to IPs in the range of [192.168.1.0 to 192.168.1.255] and a specified port. but the connect function of Winsock freezes and blocks on first IP (192.168.1.0). I think that I should change the blocking behavior of socket. I was wondering if somebody could answer following question: 1) Do I have to change my socket to non blocking mode? Is there other solutions which solves my problem?(In other words, did I choose a right way to detect the service?) 2)How can I change my socket to non blocking mode? regards,
-
Hi everyone, I am trying to write a program which searches for a service on a network. I tries to connect to IPs in the range of [192.168.1.0 to 192.168.1.255] and a specified port. but the connect function of Winsock freezes and blocks on first IP (192.168.1.0). I think that I should change the blocking behavior of socket. I was wondering if somebody could answer following question: 1) Do I have to change my socket to non blocking mode? Is there other solutions which solves my problem?(In other words, did I choose a right way to detect the service?) 2)How can I change my socket to non blocking mode? regards,
-
1. Yes, if you don't want to wait. 2. See http://www.scottklement.com/rpg/socktut/nonblocking.html[^].
Veni, vidi, abiit domum
Thanks my friend, :) Can you tell me how I can cancel a non blocking connect? I mean when I call non blocking connect the process begins and my function returns immediately but after a while I want to cancel the process. Do I have to close the socket? Or there is a simpler way that avoid closing socket? regards,
-
Thanks my friend, :) Can you tell me how I can cancel a non blocking connect? I mean when I call non blocking connect the process begins and my function returns immediately but after a while I want to cancel the process. Do I have to close the socket? Or there is a simpler way that avoid closing socket? regards,