# oscP5 TCPIP stop in client cant disconnect from server

**URL:** https://discourse.processing.org/t/oscp5-tcpip-stop-in-client-cant-disconnect-from-server/5178
**Category:** Libraries
**Created:** [November 4, 2018, 9:14am UTC](https://discourse.processing.org/t/oscp5-tcpip-stop-in-client-cant-disconnect-from-server/5178 "2018-11-04T09:14:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![GeorgeJava](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/georgejava/32/7646_2.png) [@GeorgeJava](https://discourse.processing.org/u/GeorgeJava)
#### Post date: [November 4, 2018, 9:14am UTC](https://discourse.processing.org/t/oscp5-tcpip-stop-in-client-cant-disconnect-from-server/5178/1 "2018-11-04T09:14:37Z")

</div>

Hello, i want to stop and start new connection, but oscP5tcpClient.stop(); not working…  
Can i somehow disconnect from the server ? and create new connection ?

CLIENT

```auto
import oscP5.*;
OscP5 oscP5tcpClient;
OscMessage m;
 
String input;
 
void setup() {
  size(500, 500);
  oscP5tcpClient = new OscP5(this, "localhost", 29922, OscP5.TCP);
  send("HELLO");
}
 
void draw() {
}

void mouseReleased() {
  reconnect();
}
 
void reconnect() {
  oscP5tcpClient.stop(); // <--- NOT WORKING !!!
  println("STOPPED");
  oscP5tcpClient = new OscP5(this, "localhost", 29922, OscP5.TCP);
  send("HELLO");
}

```

SERVER

```auto
import oscP5.*;
import netP5.*;
OscP5 oscP5tcpServer;
NetAddress myServerAddress;
 
String input;
 
void setup() {
  oscP5tcpServer = new OscP5(this, 29922, OscP5.TCP);
}
 
void oscEvent(OscMessage theMessage) {
  input = theMessage.addrPattern();
  println(input); 
}

```

Here it is… the server console, it only create new connection, doesnt stop the last connection … 😕  
 ![ERRORO](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/bc676ca7cce4953d5013dcd4f5f278374403bd01.png)

---

<div class="post-metadata">

### Author: ![GeorgeJava](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/georgejava/32/7646_2.png) [@GeorgeJava](https://discourse.processing.org/u/GeorgeJava)
#### Post date: [November 4, 2018, 9:34am UTC](https://discourse.processing.org/t/oscp5-tcpip-stop-in-client-cant-disconnect-from-server/5178/2 "2018-11-04T09:34:38Z")

</div>

now its works !!! just replace:

`oscP5tcpClient.stop();`

to:

`oscP5tcpClient.tcpClient().dispose();`

🙂 thx
