Android — Open multiple Sockets (Input and Output Streams) for one connection?

It is of course possible, but I am guessing you use blocking calls for the sockets, so you will need more than one thread to do useful work in real time. This also means you need a bit of synchronization between threads if they are to communicate Your'e question is frankly a bit vague, so I don't think you will get any good answers unless you qualify it a bit: what exactly do you want to do? Why do you need more than one socket?

What is the second socket for?

It is of course possible, but I am guessing you use blocking calls for the sockets, so you will need more than one thread to do useful work in real time. This also means you need a bit of synchronization between threads if they are to communicate. Your'e question is frankly a bit vague, so I don't think you will get any good answers unless you qualify it a bit: what exactly do you want to do?

Why do you need more than one socket? What is the second socket for?

I want my first input/output stream for polling frequently , while my second input/output stream will be sending random non frequent commands to bluetooth device – Shahab Feb 9 at 12:24 From that description I still don't see why you would need more than one connection, unless there are commands that are long-running and needs to be overlapping in time. – sandos Feb 9 at 22:39 yah my frequently polling thread is long running , I don't want my non frequent commands to hang up before execution – Shahab Feb 10 at 7:59 1 Well I couldn't , because the custom hardware was built that way to which I was trying to connect. – Shahab Jun 16 at 6:48.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions