From bba0335bbea81519beafb7fec1979a0abbd8a7ea Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 01 Oct 2002 14:27:17 +0000 Subject: 5th try initial checkin of X11 Opie stuff it features an IPC Server the client is todo this will become the OPIE X11 department including alternative QPEApplication, QCOP replacement --- (limited to 'x11/ipc/test/testcon.c') diff --git a/x11/ipc/test/testcon.c b/x11/ipc/test/testcon.c new file mode 100644 index 0000000..22382b1 --- a/dev/null +++ b/x11/ipc/test/testcon.c @@ -0,0 +1,58 @@ +#include +#include +#include + +#include +#include + +struct head { + int magic; + int flags; + int chlen; + int funclen; + int datalen; +}; + +int main( int argc, char* argv[] ) { + int fd, groesse; + struct sockaddr_un unix_adr; + struct head he; + char* ch = "QPE/System"; + char* fun = "call()"; + int test; + char te; + + + if( ( fd = socket(PF_UNIX, SOCK_STREAM, 0 ) ) < 0 ){ + printf("Could not socket\n" ); return 0; + } + + memset(&unix_adr, 0, sizeof(unix_adr ) ); + unix_adr.sun_family = AF_UNIX; + strcpy(unix_adr.sun_path, "/home/ich/.opie.cop"); + groesse = sizeof(unix_adr.sun_family) + strlen(unix_adr.sun_path); + + connect(fd, (struct sockaddr*)&unix_adr, groesse ); + + test= 260; + //te = (char)test; + //write(fd,&test,sizeof(test)); + + + he.magic = 47; + he.flags = 5; + he.chlen = strlen(ch); + he.funclen = strlen(fun); + he.datalen = 0; + + for(;;){ + write(fd,&he,sizeof(he) ); + //write(fd,(char*)&he.magic,1); + write(fd,ch,strlen(ch) ); + write(fd,fun,strlen(fun) ); + sleep(5); + }; + + + +} -- cgit v0.9.0.2