Search Results

Search found 232 results on 10 pages for 'ipc'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • IPC problem in the c# - ipc is already registered

    - by Lily
    hi I am trying to create two IPC channels IpcChannel ipcChannel = new IpcChannel("DroolsClient"); ChannelServices.RegisterChannel(ipcChannel, false); objec = (DroolsInterface.RulesEngineInterface)Activator.GetObject(typeof(DroolsInterface.RulesEngineInterface), "ipc://Drools/SreeniRemoteObj"); IpcChannel ipcChannel2 = new IpcChannel("ProxemClient"); ChannelServices.RegisterChannel(ipcChannel2, true); objec2 = (ProxemProject.ProxemInterface)Activator.GetObject(typeof(ProxemProject.ProxemInterface), "ipc://ProxemProcess/SreeniRemoteObj"); But when it gets to the second ChannelServices it gives an error The channel 'ipc' is already registered Would anyone be kind enough to help please

    Read the article

  • IPC speed and compare

    - by Lily
    I am trying to implement a real-time application which involves IPC across different modules. The modules are doing some data intensive processing. I am using message queue as the backbone(Activemq) for IPC in the prototype, which is easy(considering I am a totally IPC newbie), but it's very very slow. Here is my situation: I have isolated the IPC part so that I could change it other ways in future. I have 3 weeks to implement another faster version. ;-( IPC should be fast, but also comparatively easy to pick up I have been looking into different IPC approaches: socket, pipe, shared memory. However, I have no experience in IPC, and there is definitely no way I could fail this demo in 3 weeks... Which IPC will be the safe way to start with? Thanks. Lily

    Read the article

  • simplifying templates

    - by Lodle
    I have a bunch of templates that are used for rpc and was wondering if there is a way to simplify them down as it repeats it self allot. I know varags for templates is coming in the next standard but can you do default values for templates? Also is there a way to handle void functions as normal functions? Atm i have to separate them and treat them as two different things every where. template <typename R> R functionCall(IPC::IPCClass* c, const char* name) { IPC::IPCParameterI* r = c->callFunction( name, false ); return handleReturn<R>(r); } template <typename R, typename A> R functionCall(IPC::IPCClass* cl, const char* name, A a) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a)); return handleReturn<R>(r); } template <typename R, typename A, typename B> R functionCall(IPC::IPCClass* cl, const char* name, A a, B b) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b) ); return handleReturn<R>(r); } template <typename R, typename A, typename B, typename C> R functionCall(IPC::IPCClass* cl, const char* name, A a, B b, C c) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c) ); return handleReturn<R>(r); } template <typename R, typename A, typename B, typename C, typename D> R functionCall(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d) ); return handleReturn<R>(r); } template <typename R, typename A, typename B, typename C, typename D, typename E> R functionCall(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d, E e) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d), IPC::getParameter(e) ); return handleReturn<R>(r); } template <typename R, typename A, typename B, typename C, typename D, typename E, typename F> R functionCall(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d, E e, F f) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d), IPC::getParameter(e), IPC::getParameter(f) ); return handleReturn<R>(r); } inline void functionCallV(IPC::IPCClass* cl, const char* name) { IPC::IPCParameterI* r = cl->callFunction( name, false ); handleReturnV(r); } template <typename A> void functionCallV(IPC::IPCClass* cl, const char* name, A a) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a)); handleReturnV(r); } template <typename A, typename B> void functionCallV(IPC::IPCClass* cl, const char* name, A a, B b) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b) ); handleReturnV(r); } template <typename A, typename B, typename C> void functionCallV(IPC::IPCClass* cl, const char* name, A a, B b, C c) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c) ); handleReturnV(r); } template <typename A, typename B, typename C, typename D> void functionCallV(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d) ); handleReturnV(r); } template <typename A, typename B, typename C, typename D, typename E> void functionCallV(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d, E e) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d), IPC::getParameter(e) ); handleReturnV(r); } template <typename A, typename B, typename C, typename D, typename E, typename F> void functionCallV(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d, E e, F f) { IPC::IPCParameterI* r = cl->callFunction( name, false, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d), IPC::getParameter(e), IPC::getParameter(f) ); handleReturnV(r); } inline void functionCallAsync(IPC::IPCClass* cl, const char* name) { IPC::IPCParameterI* r = cl->callFunction( name, true ); handleReturnV(r); } template <typename A> void functionCallAsync(IPC::IPCClass* cl, const char* name, A a) { IPC::IPCParameterI* r = cl->callFunction( name, true, IPC::getParameter(a)); handleReturnV(r); } template <typename A, typename B> void functionCallAsync(IPC::IPCClass* cl, const char* name, A a, B b) { IPC::IPCParameterI* r = cl->callFunction( name, true, IPC::getParameter(a), IPC::getParameter(b) ); handleReturnV(r); } template <typename A, typename B, typename C> void functionCallAsync(IPC::IPCClass* cl, const char* name, A a, B b, C c) { IPC::IPCParameterI* r = cl->callFunction( name, true, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c) ); handleReturnV(r); } template <typename A, typename B, typename C, typename D> void functionCallAsync(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d) { IPC::IPCParameterI* r = cl->callFunction( name, true, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d) ); handleReturnV(r); } template <typename A, typename B, typename C, typename D, typename E> void functionCallAsync(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d, E e) { IPC::IPCParameterI* r = cl->callFunction( name, true, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d), IPC::getParameter(e) ); handleReturnV(r); } template <typename A, typename B, typename C, typename D, typename E, typename F> void functionCallAsync(IPC::IPCClass* cl, const char* name, A a, B b, C c, D d, E e, F f) { IPC::IPCParameterI* r = cl->callFunction( name, true, IPC::getParameter(a), IPC::getParameter(b), IPC::getParameter(c), IPC::getParameter(d), IPC::getParameter(e), IPC::getParameter(f) ); handleReturnV(r); }

    Read the article

  • IPC::Open3 Fails Running Under Apache

    - by rjray
    I have a module that uses IPC::Open3 (or IPC::Open2, both exhibit this problem) to call an external binary (bogofilter in this case) and feed it some input via the child-input filehandle, then reads the result from the child-output handle. The code works fine when run in most environments. However, the main use of this module is in a web service that runs under Apache 2.2.6. And under that environment, I get the error: Cannot fdopen STDOUT: Invalid argument This only happens when the code runs under Apache. Previously, the code constructed a horribly complex command, which included a here-document for the input, and ran it with back-ticks. THAT worked, but was very slow and prone to breaking in unique and perplexing ways. I would hate to have to revert to the old version, but I cannot crack this.

    Read the article

  • Multi-reader IPC solution?

    - by gct
    I'm working on a framework in C++ (just for fun for now), that lets the user write plugins that use a standard API to stream data between each other. There's going to be three basic transport mechanisms for the data: files, sockets, and some kind of IPC piping system. The system is set up so that for the non-file transport, each stream can have multiple readers. IE once a server socket it setup, multiple computers can connect and stream the data. I'm a little stuck at the multi-reader IPC system though. All my plugins run in threads so they live in the same address space, so some kind of shared memory system would work fine, I was thinking I'd write my own circular buffer with a write pointer and read pointers chassing it around the buffer, but I have my doubts that I can achieve the same performance as something like linux pipes. I'm curious what people would suggest for a multi-reader solution to something like this? Is the overhead for pipes or domain sockets low enough that I could just open a connection to each reader and issue separate writes to each reader? This is intended to be significant volumes of data (tens of mega-samples/sec), so performance is a must.

    Read the article

  • Dealing with security on IPC remoting channel

    - by leppie
    Hi I am trying to run a service under a different user account from the application that will access the service via remoting. While under the same account everything is fine, but as soon as I use different accounts, I get an access denied error while trying to open the IPC port. Is there something I am missing, as I can't see from the MSDN docs what is supposed to be done. Thanks

    Read the article

  • Android Couchdb - libcouch and IPC Aidl Services

    - by dirtySanchez
    I am working on a native CouchdDB app with android. Now just this week CouchOne released libcouch, described as "Library files needed to interact with CouchDB on Android": couchone_libcouch@Github It is a basic app that installs CouchDB if the CouchDB service (that comes with CouchDB if it was installed previously) can't be bound to. To be more precise, as I understand it: libcouch estimates CouchDb's presence on the device by trying to bind to a IPC Service from CouchDB and through that service wants communicate with CouchDB. Please see the method "attemptLaunch()" at CouchAppLauncher.class for reviewing this: public void attemptLaunch() { Log.i(TAG,"1.) called attemptLaunch"); Intent intent = new Intent(ICouchService.class.getName()); Log.i(TAG,"1.a) setup Intent"); Boolean canStart = bindService(intent, couchServiceConn, Context.BIND_AUTO_CREATE); Log.i(TAG,"1.b bound service. canStart: " + Boolean.toString(canStart)); if (!canStart) { setContentView(R.layout.install_couchdb); TextView label = (TextView) findViewById(R.id.install_couchdb_text); Button btn = (Button) this.findViewById(R.id.install_couchdb_btn); String text = getString(R.string.app_name) + " requires Apache CouchDB to be installed."; label.setText(text); // Launching the market will fail on emulators btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { launchMarket(); finish(); } }); } } The question(s) I have about this are: libcouch never is able to "find" a previously installed CouchDB. It always attempts to install CouchDB from the market. This is because it never actually is able to bind to the CouchDBService. As I understand the purpose auf AIDL generated service interfaces, the actual service that intends to offer it's IPC to other applications should make use of AIDL. In this case the AIDL has been moved to the application that is trying to bind to the remote service, which is libcouch in this case. Reviewing the commits the AIDL files have just been moved out of that repository to libcouch. For complete linkage, here's the link to the Android CouchDB sources: github.com/couchone/libcouch-android Now, I could be completely wrong in my findings, it could also be lincouch's Manifest that s missing something, but I am really looking forward to get some answers!

    Read the article

  • Is it easy to do IPC with wxWidgets?

    - by George Edison
    Is it easy to create an IPC setup with wxWidgets? I have an application that needs to detect if a previous instance is running and send a message to the running instance with a string value. Is there an easier way to do this than setting up a wxServer and wxClient-derived class?

    Read the article

  • IPC using SendMessage but receiver have random window caption

    - by iira
    I found "Delphi Inter Process Communication (IPC) using SendMessage" with Google. Here's a piece of the code from Sender to send a message for Receiver : procedure TfrmClient.FormCreate(Sender: TObject); begin MyMsg := RegisterWindowMessage('MyMessage'); ServerApplicationHandle := FindWindow('TApplication', 'Project1'); end; The problem is my receiver have random caption name. So how can I send a message to receiver? Any idea? My Sender is a DLL and my receiver is Exe.

    Read the article

  • wget not behaving via IPC::Open3 vs bash

    - by Ryley
    I'm trying to stream a file from a remote website to a local command and am running into some problems when trying to detect errors. The code looks something like this: use IPC::Open3; my @cmd = ('wget','-O','-','http://10.10.1.72/index.php');#any website will do here my ($wget_pid,$wget_in,$wget_out,$wget_err); if (!($wget_pid = open3($wget_in,$wget_out,$wget_err,@cmd))){ print STDERR "failed to run open3\n"; exit(1) } close($wget_in); my @wget_outs = <$wget_out>; my @wget_errs = <$wget_err>; print STDERR "wget stderr: ".join('',@wget_errs); #page and errors outputted on the next line, seems wrong print STDERR "wget stdout: ".join('',@wget_outs); #clean up after this, not shown is running the filtering command, closing and waitpid'ing When I run that wget command directly from the command-line and redirect stderr to a file, something sane happens - the stdout will be the downloaded page, the stderr will contain the info about opening the given page. wget -O - http://10.10.1.72/index.php 2> stderr_test_file When I run wget via open3, I'm getting both the page and the info mixed together in stdout. What I expect is the loaded page in one stream and STDERR from wget in another. I can see I've simplified the code to the point where it's not clear why I want to use open3, but the general plan is that I wanted to stream stdout to another filtering program as I received it, and then at the end I was going to read the stderr from both wget and the filtering program to determine what, if anything went wrong. Other important things: I was trying to avoid writing the wget'd data to a file, then filtering that file to another file, then reading the output. It's key that I be able to see what went wrong, not just reading $? 8 (i.e. I have to tell the user, hey, that IP address is wrong, or isn't the right kind of website, or whatever). Finally, I'm choosing system/open3/exec over other perl-isms (i.e. backticks) because some of the input is provided by untrustworthy users.

    Read the article

  • How to use pipes for nonblocking IPC (UART emulation)

    - by codebauer
    I would like to write some test/emulation code that emulates a serial port connection. The real code looks like this: DUT <- UART - testtool.exe My plan is to use create a test application (CodeUnderTest.out) on linux that forks to launch testool.out with two (read & write) named pipes as arguments. But I cannot figure out how to make all the pipe IO non-blocking! The setup would look like this:. CodeUnderTest.out <- named pipes - testTool.out (lauched from CodeUnderTest.out) I have tried opening the pipes as following: open(wpipe,O_WRONLY|O_NONBLOCK); open(rpipe,O_RDONLY|O_NONBLOCK); But the write blocks until the reader opens the wpipe. Next I tried the following: open(wpipe,O_RDWR|O_NONBLOCK); open(rpipe,O_RDONLY|O_NONBLOCK); But then the reader of the first message never gets any data (doesn't block though) I also tried adding open and close calls around each message, but that didn't work either... Here is some test code: #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> pid_t pid; char* rpipe, *wpipe,*x; FILE *rh,*wh; int rfd,wfd; void openrpipe( void ) { rfd = open(rpipe,O_RDONLY|O_NONBLOCK); rh = fdopen(rfd,"rb"); printf("%sopeningr %x\n",x,rh); } void openwpipe( void ) { //Fails when reader not already opened //wfd = open(wpipe,O_WRONLY|O_NONBLOCK); wfd = open(wpipe,O_RDWR|O_NONBLOCK); wh = fdopen(wfd,"wb"); printf("%sopeningw %x\n",x,wh); } void closerpipe( void ) { int i; i = fclose(rh); printf("%sclosingr %d\n",x,i); } void closewpipe( void ) { int i; i = fclose(wh); printf("%sclosingw %d\n",x,i); } void readpipe( char* expect, int len) { char buf[1024]; int i=0; printf("%sreading\n",x); while(i==0) { //printf("."); i = fread(buf,1,len,rh); } printf("%sread (%d) %s\n",x,i,buf); } void writepipe( char* data, int len) { int i,j; printf("%swriting\n",x); i = fwrite(data,1,len,rh); j = fflush(rh); //No help! printf("%sflush %d\n",x,j); printf("%swrite (%d) %s\n",x,i,data); } int main(int argc, char **argv) { rpipe = "readfifo"; wpipe = "writefifo"; x = ""; pid = fork(); if( pid == 0) { wpipe = "readfifo"; rpipe = "writefifo"; x = " "; openrpipe(); openwpipe(); writepipe("paul",4); readpipe("was",3); writepipe("here",4); closerpipe(); closewpipe(); exit(0); } openrpipe(); openwpipe(); readpipe("paul",4); writepipe("was",3); readpipe("here",4); closerpipe(); closewpipe(); return( -1 ); } BTW: To use the testocd above you need to pipes in the cwd: mkfifo ./readfifo mkfifo ./writefifo

    Read the article

  • IPC: Communication between Qt4 and MONO processes (on linux)

    - by elcuco
    I have to connect a Qt4 application to a mono Application. The current proof of concept uses network sockets (which is nice, I can debug using nc on the command line). But I am open to new suggestions. What are my alternatives? Edit: The original application stack is split into two parts: server + client. The client is supposed to show pictures and videos. Since we found that this is not possible in a sane way in Mono, we split the client into two parts: server - client - GUI In the original implementation the client+GUI were the same application. Now client is in C# (running on Mono), and the GUI is Qt4. Rewriting the client in Qt4 is not an option. Right now the communication between the client and the GUI is been done using TCP sockets through localhost. I am looking for better implementations.

    Read the article

  • Shared Memory and Process Sempahores (IPC)

    - by fsdfa
    This is an extract from Advanced Liniux Programming: Semaphores continue to exist even after all processes using them have terminated. The last process to use a semaphore set must explicitly remove it to ensure that the operating system does not run out of semaphores.To do so, invoke semctl with the semaphore identifier, the number of semaphores in the set, IPC_RMID as the third argument, and any union semun value as the fourth argument (which is ignored).The effective user ID of the calling process must match that of the semaphore’s allocator (or the caller must be root). Unlike shared memory segments, removing a semaphore set causes Linux to deallocate immediately. If a process allocate a shared memory, and many process use it and never set to delete it (with shmctl), if all them terminate, then the shared page continues being available. (We can see this with ipcs). If some process did the shmctl, then when the last process deattached, then the system will deallocate the shared memory. So far so good (I guess, if not, correct me). What I dont understand from that quote I did, is that first it say: "Semaphores continue to exist even after all processes using them have terminated." and then: "Unlike shared memory segments, removing a semaphore set causes Linux to deallocate immediately."

    Read the article

  • C IPC waiting for child

    - by Gary
    So I have a program which creates a child process and executes a command (for example, ls). The parent will then use pipes to send to and get from the child. This works fine when I'm inputting commands myself from the command line. However, when the input comes from a file, it seems like the child doesn't have enough time to run and I get NULL when reading from the pipe - even though there will be information coming from it. Short of using sleep(), is there a better way to make sure the child has run before trying to read from it? Thanks a lot!

    Read the article

  • Python IPC, popen too slow

    - by UnableToLoad
    i need to run a subprocess (./myProgram) form python script and get output, actually i do this: import subprocess proc = subprocess.Popen('./generate_out', shell=False, stdout=subprocess.PIPE, ) while proc.poll() is None: out = proc.stdout.readline() data = doStuff(out) print(data) but is slow, sometimes pass a lot of time between the output produced by ./generate_out and the print(data), knowing that my doStuff() function is very fast, i think there is some buffer slowing down my pipe... Notes: ./generate_out, generates potentially an unlimited number of lines of finite length each. It seems that when too few chars are put in the pipe between the two processes nothing happens, then when enough is produced i get a huge print (non the expected behaviour!) sometimes i wait many seconds (10-20 and more) between generate_out print and python print) what can i do? maybe communicate() is faster? anithing else? Thank you a lot!

    Read the article

  • Fast inter-process (inter-threaded) communications IPC on large multi-cpu system.

    - by IPC
    What would be the fastest portable bi-directional communication mechanism for inter-process communication where threads from one application need to communicate to multiple threads in another application on the same computer, and the communicating threads can be on different physical CPUs). I assume that it would involve a shared memory and a circular buffer and shared synchronization mechanisms. But shared mutexes are very expensive (and there are limited number of them too) to synchronize when threads are running on different physical CPUs.

    Read the article

  • Is it possible to use IPC inside of a IE8 Browser Helper Object?

    - by Joel
    I need to communicate with a Service using IPC from inside of a Browser Helper Object (registered with IE8). Unfortunately, all of this communication is done through an Assembly API that I have no control over. Whenever this API starts up I get the following error: ExceptionSystem.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: The system cannot find the file specified. I realize that it is difficult to discern what the issue is without source. However I am curious if anyone knows of anything sort of permissions or DLL issues that would prevent IPC from working in this case.

    Read the article

  • Python Multiprocessing with Queue vs ZeroMQ IPC

    - by Imraan
    I am busy writing a Python application using ZeroMQ and implementing a variation of the Majordomo pattern as described in the ZGuide. I have a broker as an intermediary between a set of workers and clients. I want to do some extensive logging for every request that comes in, but I do not want the broker to waste time doing that. The broker should pass that logging request to something else. I have thought of two ways :- Create workers that are only for logging and use the ZeroMQ IPC transport Use Multiprocessing with a Queue I am not sure which one is better or faster for that matter. The first option does allow me to use the current worker base classes that I already use for normal workers, but the second option seems quicker to implement. I would like some advice or comments on the above or possibly a different solution.

    Read the article

  • IPC linux huge transaction

    - by poly
    I'm building and application that requires huge transactions/sec of data and I need to use IPC to for the mutithreaded mutliprocceses communication, I know that there are a lot of methods to be used but not sure which one to choose for this application. This is what the application is gonna have, 4 processes, each process has 4 threads, the data chunk that needs to be transferred between two or more threads is around 400KB. I found that fifo is good choice except that it's 64K which is not that big so i'll need to modify and recompile the kernel but not sure if this is the right thing to do? Anyway, I'm open to any suggestions and I'd like to squeeze your experience in this :) and I appreciate it in advance.

    Read the article

  • Want to Receive dynamic length data from a message queue in IPC?

    - by user1089679
    Here I have to send and receive dynamic data using a SysV message queue. so in structure filed i have dynamic memory allocation char * because its size may be varies. so how can i receive this type of message at receiver side. Please let me know how can i send dynamic length of data with message queue. I am getting problem in this i posted my code below. send.c /*filename : send.c *To compile : gcc send.c -o send */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> struct my_msgbuf { long mtype; char *mtext; }; int main(void) { struct my_msgbuf buf; int msqid; key_t key; static int count = 0; char temp[5]; int run = 1; if ((key = ftok("send.c", 'B')) == -1) { perror("ftok"); exit(1); } printf("send.c Key is = %d\n",key); if ((msqid = msgget(key, 0644 | IPC_CREAT)) == -1) { perror("msgget"); exit(1); } printf("Enter lines of text, ^D to quit:\n"); buf.mtype = 1; /* we don't really care in this case */ int ret = -1; while(run) { count++; buf.mtext = malloc(50); strcpy(buf.mtext,"Hi hello test message here"); snprintf(temp, sizeof (temp), "%d",count); strcat(buf.mtext,temp); int len = strlen(buf.mtext); /* ditch newline at end, if it exists */ if (buf.mtext[len-1] == '\n') buf.mtext[len-1] = '\0'; if (msgsnd(msqid, &buf, len+1, IPC_NOWAIT) == -1) /* +1 for '\0' */ perror("msgsnd"); if(count == 100) run = 0; usleep(1000000); } if (msgctl(msqid, IPC_RMID, NULL) == -1) { perror("msgctl"); exit(1); } return 0; } receive.c /* filename : receive.c * To compile : gcc receive.c -o receive */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> struct my_msgbuf { long mtype; char *mtext; }; int main(void) { struct my_msgbuf buf; int msqid; key_t key; if ((key = ftok("send.c", 'B')) == -1) { /* same key as send.c */ perror("ftok"); exit(1); } if ((msqid = msgget(key, 0644)) == -1) { /* connect to the queue */ perror("msgget"); exit(1); } printf("test: ready to receive messages, captain.\n"); for(;;) { /* receive never quits! */ buf.mtext = malloc(50); if (msgrcv(msqid, &buf, 50, 0, 0) == -1) { perror("msgrcv"); exit(1); } printf("test: \"%s\"\n", buf.mtext); } return 0; }

    Read the article

  • Portable C++ library for IPC (processes and shared memory), Boost vs ACE vs Poco?

    - by user363778
    Hi, I need a portable C++ library for doing IPC. I used fork() and SysV shared memory until now but this limits me to Linux/Unix. I found out that there are 3 major C++ libraries that offer a portable solution (including Windows and Mac OS X). I really like Boost, and would like to use it but I need processes and it seems like that this is only an experimental branch until now!? I have never heard of ACE or POCO before and thus I am stuck I do not know which one to choose. I need fork(), sleep() (usleep() would be great) and shared memory of course. Performance and documentation are also important criteria. Thanks, for your Help!

    Read the article

1 2 3 4 5 6 7 8 9 10  | Next Page >