All Questions

3
votes
2answers
1737 views

Sending a sequence of commands and wait for response

I have to update firmware and settings on a device connected to a serial port. Since this is done by a sequence of commands, I send a command and wait until I recive an answer. Inside the answere (man...
55
votes
8answers
89775 views

Polling the keyboard (detect a keypress) in python

How can I poll the keyboard from a console python app? Specifically, I would like to do something akin to this in the midst of a lot of other I/O activities (socket selects, serial port access, etc.)...
28
votes
23answers
61200 views

How to prevent downloading images and video files from my website?

How to prevent downloading images and video files from my website? Is it possible? What would be the best way to do this?
116
votes
6answers
68968 views

How can I interrupt a ServerSocket accept() method?

In my main thread I have a while(listening) loop which calls accept() on my ServerSocket object, then starts a new client thread and adds it to a Collection when a new client is accepted. I also have...
15
votes
1answers
21575 views

Linux Blocking vs. non Blocking Serial Read

i have this code for reading from Serial in Linux , but i don't know what is the difference between blocking and non blocking in reading Serial Port and which one is better in which situation?
275
votes
10answers
76124 views

asynchronous vs non-blocking

What is the difference between asynchronous and non-blocking calls? Also between blocking and synchronous calls (with examples please)?
47
votes
8answers
82009 views

Java InputStream blocking read

According to the java api, the InputStream.read() is described as: If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until ...
9
votes
5answers
28551 views

How to block a mobile number call and message receiving in android application development?

I would like to implement an application for block a mobile number for receiving or sending calls and messages. In my application I am entering mobile number at EditText box then I am clicking a butto...
8
votes
4answers
8544 views

What are some reasons NetworkStream.Read would hang/block?

MSDN documentation seems to suggest that NetworkStream.Read will always return immediately. If no data is found it returns 0. However, I have some code that is currently deployed, that only in some ca...
73
votes
5answers
30043 views

How to interrupt a BlockingQueue which is blocking on take()?

I have a class that takes objects from a BlockingQueue and processes them by calling take() in a continuous loop. At some point I know that no more objects will be added to the queue. How do I inter...

Previous Next