|
Home > Archive > Unix Programming > January 2005 > Need help with socket communication
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Need help with socket communication
|
|
| Azzedine 2005-01-21, 5:52 pm |
| Dear All,
Currently I am developping a communiction between two different executables
(Fortran package and Matlab) with sockets. The Fortran package is as client
and Matlab is as server. So, the communication should be bi-directional in
order to exchange data between them.
When I exchange data between Fortran package and Matlab, sometime the
communication stops, because it requires to pass values durring the
processing of the programs. Could someone please help and tell me if that is
possible to communicate bi-directional through one socket without stopping
the communication???
Or if that is better to use two sockets (first uses one way and the second
is for passing back) then one only. I would be glad if you would help and
tell me which procedure should be made for such communication.
Thanking you in advance for your help,
| |
| Fletcher Glenn 2005-01-21, 5:52 pm |
| Azzedine wrote:
> Dear All,
>
> Currently I am developping a communiction between two different executables
> (Fortran package and Matlab) with sockets. The Fortran package is as client
> and Matlab is as server. So, the communication should be bi-directional in
> order to exchange data between them.
>
> When I exchange data between Fortran package and Matlab, sometime the
> communication stops, because it requires to pass values durring the
> processing of the programs. Could someone please help and tell me if that is
> possible to communicate bi-directional through one socket without stopping
> the communication???
> Or if that is better to use two sockets (first uses one way and the second
> is for passing back) then one only. I would be glad if you would help and
> tell me which procedure should be made for such communication.
>
> Thanking you in advance for your help,
>
>
You're not telling us anything about your implementation, and more to
the point, your assumptions. It is easy to communicate on one socket.
What most people fail to understand is that there is no message by
message boundary. One "message" may be a concatenation of several
original messages, or it could be a fragment of one original message.
Your code must be able to sort this out.
Also, beware of deadlocking. This is a situation where both programs
are waiting on a response from the other before proceeding.
--
Fletcher Glenn
|
|
|
|
|