Question about the Socket~

I'm making an interface by using SOCKET to transfer the data between the Java program and Plant Simulation.

Currently, I am using a simple example to do the experiment on a same computer. Plant Simulation as a client.

The first problem is that when Plant Simulation send the message to Java. After I run the 'SendMessages' method, Java can not receive the message immediately. However, if I open the SOCKET and click the 'OK' button, the message can be received at that time. So I add some codes to execute this 'OPEN & OK' operation. So now Java can receive the message from Plant Simulation. But I wonder to know the reason why I need to open the SOCKET and click the OK button?

The second problem is that the message can be sent to the Java program from Plant Simulation as I mentioned. However, Plant Simulation is not able to receive the message from Java program. The figure shows the settings.

Can you please let me know whether I'm using correct method or any changes I want to make it run?

Re: Question about the Socket~

after you have sent a message the operating system decides when the message is sent over the network.

Basically it waits until the send buffer is full or there is no more data coming within a time limit.

You can use the method 'setSendBufferSize' to define the size of the send buffer.

To receive data without having a connection to a server socket you need a socket which has the 'Server Socket' checked.

Regards,

Ralf------------------------------------------------------------------------------------------------------Did you like the answer? Then click the Thumbs Up button.Did the answer solve your problem? Then accept the answer as solution.