Hello all developers,

I am facing this spcl type of issue with socket connection with
server.When first time connect with server then it's true
response.Server connecting successful.

when   trying to connect second time then not connecting with
server.bez socket connection is not closing with server.when
restarting the server then again it's give true response.

after one response it's not connecting with server.first time it's
give response of server  when server startup.

               Socket smtpSocket = null;
                String os = null;
                DataInputStream is = null;
        // Initialization section:
        // Try to open a socket on port 25
        // Try to open input and output streams
                try {

                InetAddress serverAddr = InetAddress.getByName(SERVERIP);
                    smtpSocket = new Socket(serverAddr,SERVERPORT);
                    if(smtpSocket.isConnected()){
 
System.out.println("######################Trueeeeeee");
 
System.out.println("1."+smtpSocket.getRemoteSocketAddress());
 
System.out.println("1."+smtpSocket.getReceiveBufferSize());
                    }

 
System.out.println(smtpSocket.getRemoteSocketAddress());
                   // os = new
DataOutputStream(smtpSocket.getOutputStream());
                   // is = new
DataInputStream(smtpSocket.getInputStream());
                } catch (UnknownHostException e) {
                    System.err.println("Don't know about host:
hostname");
                } catch (IOException e) {
                    System.err.println("Couldn't get I/O for the
connection to: hostname"+e);
                }
                try {

                                        smtpSocket.close();
                                } catch (IOException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }

i thing server is not closing the socket connection so, i am facing
this issue.

Please some one help me what to do kill the connection from server and
clinet side for that socket .

Thanks,

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

Reply via email to