Hi,

I tried to create a serversocket, but it is throwing IOException. How
to solve this issue?

The code is:

try {
                                        ServerSocket ss = new 
ServerSocket(port);

                                           TextView tv = 
(TextView)findViewById(R.id.status);
                       tv.setText("Server Started");
                       ss.setReuseAddress(true);
                                        while(isRunning){
                                                try {
                            Socket socket = ss.accept();
                            tv.setText("Connection Accepted");
                                                } catch (IOException e) {
                                                        tv.setText("IOException 
1");
                                                        e.printStackTrace();


                                                }
                                        }
                                }catch (IOException e) {
                                        // TODO Auto-generated catch block
                                        TextView tv = 
(TextView)findViewById(R.id.status);
                    tv.setText("Could not listen on port: " + port);
                                        e.printStackTrace();

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to