Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
how to call function at server

 
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum
Author Message
johnjohn12
Guest





Post Post subject: how to call function at server Reply with quote

Hello everybody,

I need some help from you.

It is all around socket programming.
I got my client and server worked, it is just a simple socket programming with read() and write().

Suppose I know there is a function at the server side: void foo(char *bar).
Is it possible from client to call this function? if yes, how can i do this? what should i do?

what i want to do is something like this

server and client communicate with TCP
there is a function in server call void foo(char *bar),

server.c
void foo(char *bar)
{
sprintf("yes", bar);
}

I want at the client to call that function. Can I write something like this in client?

client.c

char *A;
foo(&A);

and when i call the function I got "yes" in A

is this possible to do?

thank you
Tue Jun 15, 04 2:46 pm
Back to top
johnjohn12
Tousif
Beginner User
Beginner User


Joined: 25 May 2004
Posts: 20
Location: Nashville, Tennessee, USA

Post Post subject: Reply with quote

Hi,
you need rpc - remote procedure call. C has a library for this, which is usually <rpc/rpc.h> for example. The following link should give you more than enough information regarding how to use rpc library to be able to do your example.

[http://www.cs.cf.ac.uk/Dave/C/node33.html]

I've posted the same message on your other thread as well.

Tousif
Wed Jun 16, 04 1:59 am
Back to top
Tousif View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group