|
From: bosnio <bo...@ne...> - 2002-05-01 22:40:11
|
Hello,=20
First of all i would like to thank Samuel Bayer for the =
response to my previous e-mail.
I tried to put the code, that was sent in that e-mail but i wasn=B4t =
able to contact the hub in the proper way...
For a test i created a simple program that was supposed to connect to =
the hub send a message and receive a reply (if i can do this,i will be =
able to incorporate this in the child process of the system that i am =
trying to build, the one i explain in my last e-mail).
The problem is that the server contacts the hub sending him the a =
message identifing himself and receives a reply, but them when i send a =
message the hub does,t receive nothing,,,,=20
I will present the interaction...
This is the interaction of the echo_client, that follows the code on =
the last e-mail. (i will put the code at the end of the e-mail)
[bosnio@ninja MultipleWebClient]$ ./bin/EchoClient
GalIO_CommDispatchFrame: sending new message:
{c UI
:signatures ( )
:properties {c server_properties }
:extra_service_types ( )
:protocol_version 1 }
GalIO_CommDispatchFrame: got reply:
{c UI
:signatures ( )
:properties {c server_properties }
:extra_service_types ( )
:protocol_version 1 }
GalIO_CommDispatchFrame: sending new message:
{c SendRequest
:frase "
O meu recebe esta merda
"
:hub_opaque_data {c admin_info
:reply_requested 1
:server_tidx 1 } }
Now in the hub intercation, it appears that a socket has been open, but =
nothing more:
Hub iteraction
=20
[bosnio@ninja MultipleWebClient]$ hub -pgm_file MultipleWebClient.pgm
Reading MultipleWebClient.pgm
Done reading MultipleWebClient.pgm (15 lines)
3 service types
1 service providers
1 programs
--------------------------------------------------
service type: UI : 5000
Opening listener UI
Trying to set up listener on port 5000
reset_listener called
GalIO_ServerStart: Listening on port 5000
--------------------------------------------------
provider: for echo @ localhost:10000
GalIO_CommDispatchFrame: sending new message:
{c handshake
:conn_type 1
:protocol_version 1 }
GalIO_CommDispatchFrame: got reply:
{c echo
:signatures ( ( "echo"
( )
2
6
( )
2 ) )
:properties {c server_properties }
:extra_service_types ( )
:protocol_version 1 }
connected to provider for echo @ localhost:10000.
--------------------------------------------------
........__GalIO_ServerContactHandler: connected to 127.0.0.1 (sock=3D8)=20
The part in red is what appears when i start the client.
The echo server doesn't appear anything, and it should receive a message =
invocking his echo dispatch function.
The interaction:
=20
[bosnio@ninja MultipleWebClient]$ ./bin/Echo
reset_listener called
GalIO_ServerStart: Listening on port 10000
__GalIO_ServerContactHandler: connected to 127.0.0.1 (sock=3D7)
So this is my actual problem which i can't solve.... I hope that someone =
could help me.
I am know sending m actual PGM file and the source code of echo_client =
so that you can have a more precise look of what i am doing.
=20
---->PGM_FILE
SERVER: echo
PORT: 10000
HOST: localhost
OPERATIONS: echo=20
SERVER: UI
CLIENT_PORT: 5000
OPERATIONS: sendRequest
PROGRAM: SendRequest
RULE: --> echo
IN: :frase
OUT: :resposta
----->echoclient.c
#include "galaxy/galaxy_all.h"
#define SERVER_FUNCTIONS_INCLUDE "MultipleWebClient.h"
#define USE_SERVER_DATA
#include "galaxy/server_functions.h"
int main(int argc, char* argv[])
{
GalIO_ServerStruct *server;
GalIO_CommStruct *new_comm;
GalSS_Environment *env;
=20
char* reply;
Gal_Frame new_f =3D Gal_MakeFrame("SendRequest", GAL_CLAUSE);
Gal_Frame res_f;
GalIO_MsgType t;
=20
server =3D GalSS_CmdlineSetupServer(argc, argv);
if(!server){
GalUtil_Fatal("Failed to set up server!\n!");
}
new_comm =3D GalIO_ContactHub("localhost", 5000, server, NULL,-1);
=20
=20
env =3D GalSS_EnvCreate(new_comm);
GalSS_EnvLock(env);
Gal_SetProp(new_f, ":frase", Gal_StringObject("\nO meu recebe esta =
merda\n"));
res_f =3D GalSS_EnvDispatchFrame(env, new_f, &t);
Gal_FreeFrame(new_f);
//Falta aqui uns testes do que o mano recebeu
reply =3D Gal_GetString(res_f, ":resposta");
printf("/nOk o que o Ze dread disse foi: %s/n",reply);
Gal_FreeFrame(res_f);
GalSS_EnvUnlock(env);
}
---->echo_client.h
GAL_SERVER_NAME(UI)
GAL_SERVER_PORT(5000)
----->echo.c
#include "galaxy/galaxy_all.h"
#define SERVER_FUNCTIONS_INCLUDE "echo.h"
#define USE_SERVER_DATA
#include "galaxy/server_functions.h"
Gal_Frame echo(Gal_Frame frame, void *server_data)
{
char* msg =3D Gal_GetString(frame, ":frase");
printf("\n Recebi a mensagem: %s \n",msg);
Gal_SetProp(frame, ":resposta", Gal_StringObject(" Ok mano recebi a =
tua dica"));
return frame;
=20
}
----->echo.h
GAL_SERVER_NAME(echo)
GAL_SERVER_PORT(10000)
GAL_SERVER_OP(echo)
=20
-----------------------------------------------------------
So my problem is that it seems that i am contacting the hub, but after i =
receive my first message i can't send no more messages because they =
don't arrive at the hub.=20
Finaly i didn't quiet undestand how do you set the pool flags from what =
i have read in the documentation... How can i set them without =
GalSS_SAFixServerListenStatus, because here i must have an argument =
package...and i don't need them anywhere else. Could you please try to =
explain how do i work with the flags.
Thanks for the spared time, best Regards
Jo=E3o Gra=E7a=20
|