author | zecke <zecke> | 2002-10-01 14:27:17 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-01 14:27:17 (UTC) |
commit | bba0335bbea81519beafb7fec1979a0abbd8a7ea (patch) (side-by-side diff) | |
tree | ee334cf518c59582a36a3dd24238a05dfc3535a2 /x11/ipc/test/testcon.c | |
parent | ef8d0a15d706b0e230f052efcb1eab6f905a8737 (diff) | |
download | opie-bba0335bbea81519beafb7fec1979a0abbd8a7ea.zip opie-bba0335bbea81519beafb7fec1979a0abbd8a7ea.tar.gz opie-bba0335bbea81519beafb7fec1979a0abbd8a7ea.tar.bz2 |
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
-rw-r--r-- | x11/ipc/test/testcon.c | 58 |
1 files changed, 58 insertions, 0 deletions
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 <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include <sys/socket.h> +#include <sys/un.h> + +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); + }; + + + +} |