android Programming Glossary: serversocket.accept
Send message from a basic server to a specific client http://stackoverflow.com/questions/10777678/send-message-from-a-basic-server-to-a-specific-client creating a client socket to accept it Socket clientSocket serverSocket.accept Now I accept the client in a seperate thread so that the main.. just do it in a loop for int i 0 i 5 i clientSocket serverSocket.accept start a new thread passing it the clientSocket as an argument..
Connecting 2 Emulator instances In Android http://stackoverflow.com/questions/4683854/connecting-2-emulator-instances-in-android InetSocketAddress 10.0.2.15 4444 while true Socket socket serverSocket.accept tv.setText Connected... And code for Client public class ClientActivity..
Stream live video from phone to phone using socket fd http://stackoverflow.com/questions/6116880/stream-live-video-from-phone-to-phone-using-socket-fd while true listen for incoming clients Socket client serverSocket.accept handler.post new Runnable @Override public void run connectionStatus.setText..
Android - Server Socket http://stackoverflow.com/questions/7455016/android-server-socket Exception e e.printStackTrace while true try socket serverSocket.accept BufferedReader in new BufferedReader new InputStreamReader..
“Service discovery failed” from Android Bluetooth Insecure Rfcomm http://stackoverflow.com/questions/8515572/service-discovery-failed-from-android-bluetooth-insecure-rfcomm Connections BluetoothSocket socket while true try socket serverSocket.accept catch IOException e break if socket null Log.i TAG Received..
Android ServerSocket programming with jCIFS streaming files http://stackoverflow.com/questions/9058135/android-serversocket-programming-with-jcifs-streaming-files create Thread waiting for connection Socket accept serverSocket.accept one thread may be ok since you'd handle single client at a time.. @Override public void run try while true Socket accept serverSocket.accept new HttpSession accept catch IOException e e.printStackTrace..
Send message from a basic server to a specific client http://stackoverflow.com/questions/10777678/send-message-from-a-basic-server-to-a-specific-client ServerSocket serverSocket new ServerSocket 8000 0 IPaddress creating a client socket to accept it Socket clientSocket serverSocket.accept Now I accept the client in a seperate thread so that the main thread does not freeze becauz accept function is blocking... on stackoverflow. As to accepting connections and starting threads just do it in a loop for int i 0 i 5 i clientSocket serverSocket.accept start a new thread passing it the clientSocket as an argument Other possibly useful links https developer.android.com resources..
Connecting 2 Emulator instances In Android http://stackoverflow.com/questions/4683854/connecting-2-emulator-instances-in-android serverSocket new ServerSocket serverSocket.bind new InetSocketAddress 10.0.2.15 4444 while true Socket socket serverSocket.accept tv.setText Connected... And code for Client public class ClientActivity extends Activity Called when the activity is first..
Stream live video from phone to phone using socket fd http://stackoverflow.com/questions/6116880/stream-live-video-from-phone-to-phone-using-socket-fd on IP SERVERIP serverSocket new ServerSocket SERVERPORT while true listen for incoming clients Socket client serverSocket.accept handler.post new Runnable @Override public void run connectionStatus.setText Connected. try Begin video communication..
Android - Server Socket http://stackoverflow.com/questions/7455016/android-server-socket SERVERPORT System.out.println Server IP SERVERIP catch Exception e e.printStackTrace while true try socket serverSocket.accept BufferedReader in new BufferedReader new InputStreamReader socket.getInputStream System.out.println ip socket.getInetAddress..
“Service discovery failed” from Android Bluetooth Insecure Rfcomm http://stackoverflow.com/questions/8515572/service-discovery-failed-from-android-bluetooth-insecure-rfcomm IOException e serverSocket tmp ServerThread Listening for Connections BluetoothSocket socket while true try socket serverSocket.accept catch IOException e break if socket null Log.i TAG Received new socket connection requesting service SERVICE_NAME else..
Android ServerSocket programming with jCIFS streaming files http://stackoverflow.com/questions/9058135/android-serversocket-programming-with-jcifs-streaming-files Range values. Basic tasks of http server create ServerSocket create Thread waiting for connection Socket accept serverSocket.accept one thread may be ok since you'd handle single client at a time read http request socket.getInputStream mainly check GET.. new ServerSocket 0 mainThread new Thread new Runnable @Override public void run try while true Socket accept serverSocket.accept new HttpSession accept catch IOException e e.printStackTrace mainThread.setName Stream over HTTP mainThread.setDaemon..
|