|
Home > Archive > Unix Programming > August 2005 > does socket programming help me
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 |
does socket programming help me
|
|
|
| hello all
I am on a new project, and I am supposed to have some interfacing
between the
fortran code which does all the computations and the graphics code
which does the visualisation
part. The interfacing is basically that the graphics part written in
VRJuggler (similar to open gl) sends
a few parameters to the fortran code and the fortran code does the
required computation and sends
back the data (a huge array generally) to the graphics code.
Now, I have written a c++ program which just simulates the stuff, i.e I
pass the parameters from my c++
code to the fortran and get the result (i.e. the data.. huge arrays i
was talking about) back to
the c++ code. Now, I need to send this to the graphics part. The point
is that all the programs, i.e. the graphics , fortran are on different
computers(on different clusters).
I dont even know if what I have done till now is useful.
Now, after a little research I found out that I could use socket
programming to pass this data
from my c++ code to the graphics side and vice versa. I need to do this
passing real fast,
i mean the number of timesthe data is going to be passed either way
is very high, so all should be done real time.
So, does Socket programming really solve my problem, I am a novice in
socket programming so do tell
me the books and links that i need to refer to get things started,
because I am kind of stagnated in my project.
Regards
NM
| |
| Barry Margolin 2005-08-16, 2:50 am |
| In article <1124156686.290740.304900@g14g2000cwa.googlegroups.com>,
"NM" <nagamani.mom@gmail.com> wrote:
> hello all
>
> I am on a new project, and I am supposed to have some interfacing
> between the
> fortran code which does all the computations and the graphics code
> which does the visualisation
> part. The interfacing is basically that the graphics part written in
> VRJuggler (similar to open gl) sends
> a few parameters to the fortran code and the fortran code does the
> required computation and sends
> back the data (a huge array generally) to the graphics code.
> Now, I have written a c++ program which just simulates the stuff, i.e I
> pass the parameters from my c++
> code to the fortran and get the result (i.e. the data.. huge arrays i
> was talking about) back to
> the c++ code. Now, I need to send this to the graphics part. The point
> is that all the programs, i.e. the graphics , fortran are on different
> computers(on different clusters).
> I dont even know if what I have done till now is useful.
> Now, after a little research I found out that I could use socket
> programming to pass this data
> from my c++ code to the graphics side and vice versa. I need to do this
> passing real fast,
> i mean the number of timesthe data is going to be passed either way
> is very high, so all should be done real time.
> So, does Socket programming really solve my problem, I am a novice in
You could use Remote Procedure Call instead of direct socket
programming. The speed issues in this are going to be the network
itself, probably not the API you use.
> socket programming so do tell
> me the books and links that i need to refer to get things started,
> because I am kind of stagnated in my project.
"Unix Network Programming" by W. Richard Stevens is still one of the
best references on socket programming.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
| |
| Robben 2005-08-16, 7:51 am |
|
NM wrote:
> hello all
>
> I am on a new project, and I am supposed to have some interfacing
> between the
> fortran code which does all the computations and the graphics code
> which does the visualisation
> part. The interfacing is basically that the graphics part written in
> VRJuggler (similar to open gl) sends
> a few parameters to the fortran code and the fortran code does the
> required computation and sends
> back the data (a huge array generally) to the graphics code.
> Now, I have written a c++ program which just simulates the stuff, i.e I
> pass the parameters from my c++
> code to the fortran and get the result (i.e. the data.. huge arrays i
> was talking about) back to
> the c++ code. Now, I need to send this to the graphics part. The point
> is that all the programs, i.e. the graphics , fortran are on different
> computers(on different clusters).
> I dont even know if what I have done till now is useful.
> Now, after a little research I found out that I could use socket
> programming to pass this data
> from my c++ code to the graphics side and vice versa. I need to do this
> passing real fast,
> i mean the number of timesthe data is going to be passed either way
> is very high, so all should be done real time.
> So, does Socket programming really solve my problem, I am a novice in
> socket programming so do tell
> me the books and links that i need to refer to get things started,
> because I am kind of stagnated in my project.
I can propose three solutions
1) Sockets
2) RPC
3) CORBA
1) Sockets:
Advantages:
1) Higher performance when compared to other two options.
2) Good if too much data is passed from one computer to the other.
Disadvantages:
1) Need to define a mechanism to interpret the data which could be
complicated (example first byte is x-cordinate, second byte is
y-coordinate ...)
2) Need to cater for corrupted data.
3) Difficult to design the code and maintain
2) CORBA-RPC
Advantages: Easy to code. Easy to maintian
Disadvantages: Performace will be slightly lower when compared to
sockets, but RPC/CORBA internally uses either TCP/UDP mechanism.
I suggest you to design your codes such a way that you use RPC/CORBA
for send/recv the data, check the performance if it is not what you are
expecting, change the codes to use sockets.
I am working on a real-time project and use CORBA to send and recv
messages with-in our system and use Socket if we need to interface with
external systems.
If you are using sockets better find some socket libraries which will
handle some of the complexity for you.
>
> Regards
> NM
| |
|
| Thank you all for the replies,
now I will have to do some research on what you ve said
and get the things started.
Regards
NM
|
|
|
|
|