Socket sock = this.stack.ioHandler.sendBytes( this.peerAddress, this.peerPort, this.peerProtocol, msg, retry);    if (sock != mySock && sock != null) { try { if (mySock != null) mySock.close(); } catch (IOException ex) { } mySock = sock; this.myClientInputStream = mySock.getInputStream(); this.myClientOutputStream = mySock.getOutputStream(); Thread thread = new Thread(this); thread.setDaemon(true); thread.setName("TCPMessageChannelThread"); thread.start(); }  }
Socket sock = this.sipStack.ioHandler.sendBytes(this.messageProcessor .getIPAddress(), this.peerAddress, this.peerPort, this.peerProtocol, msg, retry);    if (sock != mySock && sock != null) { try { if (mySock != null) mySock.close(); } catch (IOException ex) { } mySock = sock; this.myClientInputStream = mySock.getInputStream(); this.myClientOutputStream = mySock.getOutputStream(); Thread thread = new Thread(this); thread.setDaemon(true); thread.setName("TCPMessageChannelThread"); thread.start(); }  }
    private void sendMessage(byte[] msg, boolean retry) throws IOException {        Socket sock =        this.stack.ioHandler.sendBytes(        this.peerAddress,        this.peerPort,        this.peerProtocol,        msg,        retry);        // Created a new socket so close the old one and stick the new        // one in its place but dont do this if it is a datagram socket.        // (could have replied via udp but received via tcp!).        if (sock != mySock && sock != null) {            try {                if (mySock != null)                    mySock.close();            } catch (IOException ex) {            }            mySock = sock;            this.myClientInputStream = mySock.getInputStream();            this.myClientOutputStream = mySock.getOutputStream();            Thread thread = new Thread(this);	    thread.setDaemon(true);            thread.setName("TCPMessageChannelThread");            thread.start();        }            }