Questions tagged [msgsend]

9 questions
1
vote
2 answers

Send the message objc_msgSend(class,@selector(dealloc)) to release the object, why is it wrong to access the object pointer?

The code is under ARC. When I delete the code NSObject* objc = (NSObject*)object; the program runs fine, but I didn't have access to the pointer objc. When I keep the code NSObject* objc = (NSObject*)object; I am prompted EXC_BAD_ACCESS (code=1,…
hyp
  • 13
  • 4
1
vote
2 answers

error: Invalid argument; while sending msgsnd() message; not matching queue ID

I was just learning IPC on linux and come up with three simple programs. One is made to create (and administrate in the feature) the message queue. The second should just send the message to the queue created by the first one. The third program is…
siery
  • 467
  • 3
  • 20
1
vote
1 answer

msgsnd Invalid argument

With the following code: #define MSGLEN 128 typedef struct { long id; char message[MSGLEN]; } data; data msg; msgsnd(msg_id, &msg, MSGLEN, IPC_NOWAIT); I get an Invalid argument error, but msgsnd(msg_id, &msg.message, MSGLEN, IPC_NOWAIT); is…
yakana
  • 41
  • 5
1
vote
1 answer

Cocos2d Game crashes when trying to replace scene

I am trying to switch between different scenes in my game. I switched from my GameLayer to a Config scene first, then switch back using the following code, but the game crashes: -(void) backToGame { [[CCDirector sharedDirector]…
zeroliu
  • 990
  • 2
  • 10
  • 15
1
vote
2 answers

Javamail demo not working

I have tried running the demo msgsend from JavaMail. I have downloaded version 1.4.5 of JavaMail and unpacked it into my JDK folder. I have added mail.jar to CLASSPATH. I have compiled msgsend.java without getting any error back. However, when I…
0
votes
1 answer

How to publish a ROS msg from one python to another

Trying to configure a basic color detection in my ROS project, I got stuck in this: I have two python scripts where "programa.py" is my main robot program and the "camara.py" is my openCV color detection script. Right now I can change the color…
0
votes
1 answer

QNX Nuetrino MsgSendv

I am using MsgSendv and server sends MSgReply like this: char desc_buf_out[MAX_CHARS_IN_A_LINE]; MsgReply(rcvid, EOK, desc_buf_out, sizeof(desc_buf_out)); My client is looking like this: iov_t *iovrcv=calloc(1,sizeof(iov_t)); …
Mehdi
  • 113
  • 1
  • 11
0
votes
1 answer

IPC message queue. msgrcv system call. System V. how to get out of loop

I have a message queue from which I am getting messages in a loop. The problem is that I don't know how to exit the loop. msgrcv returns type size_t so it keeps going. What value should I compare the return value so I can exit the…
user69514
  • 26,935
  • 59
  • 154
  • 188
0
votes
2 answers

message queue. msgsend msgrcv. System V IPC system calls in C (Linux)

Hi I'm working with some shared memory where different processes read and write data. I'm using a message queue to store messages of when data has changed between read and write operations. /* struct that defines a message */ struct msgbuf{ long…
user69514
  • 26,935
  • 59
  • 154
  • 188