Communication with a java program using a networking port via openframeworks

This is my code and for some reason it doesn’t work.
Basically I’m using port 20 to send and receive messages but c++ is not getting it. I tested it using java and it worked fine. Why isn’t this working.

void ofApp::setup()
{
udpConnection.Create();
udpConnection.Bind(20);
udpConnection.SetNonBlocking(true);
}

//--------------------------------------------------------------
void ofApp::update(){
char udpMessage[1000];
udpConnection.Receive(udpMessage, 20);
string message = udpMessage;
ofLog() << udpMessage;
}

//--------------------------------------------------------------
void ofApp::setup()
{
bool connected = tcpClient.setup(“ipaddress”, 20);
}

//--------------------------------------------------------------
void ofApp::update(){
if (tcpClient.isConnected()) {
string str = tcpClient.receive(); // did anything come in
}
}

//--------------------------------------------------------------
void ofApp::draw(){

}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
if (tcpClient.isConnected()) {
tcpClient.send(“HELLO WORLD!”);
ofLog() << “hi”;
}
ofLog() << “hti”;
}

This doesn’t workas well. :frowning:

I realized that in java you would have to place [TCP] behind the message in order for openframeworks to receive the message but can it receive more than one message and is the message deleted from the port automatically or would you have to do it through code.