Lecture 1: Introduction to 6.00
[youtube]http://youtu.be/bX3jvD7XFPs[/youtube]
Lecture 1: Introduction to 6.00
[youtube]http://youtu.be/bX3jvD7XFPs[/youtube]
회사 이메일 & 아이폰 연동..
필요하다고는 계속해서 느끼고 있었는데..
귀찮다는 이유로 계속 외면하고 있었다.
방금 설정을 끝냈다.
속이 후련하다. ㅋ
회사 이사님께서 추천해주신 C++ 책.
하루에 100 페이지씩 진도 나가기 목표로 해보자. 🙂
처음 회사에 입사했을 때의 느낌과 포부가 생각난다.
내가 진정으로 원하는 것, 내가 진정으로 바라는 것이 무엇인지..
나를 나로써 진정성있게 대하는 것. 🙂
내가 나를 사랑하는 것.
그래, 그것이다.
IPC 를 위해 MessageQueue 를 사용해야 했다.
그런데 문제는 msgsnd 시스템 함수를 통해 데이터를 보낼려고 하는데 자꾸 에러가 나는것..
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,232]<ERR>Queue Create Failed. Queue Already Created. Id[4653059]
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,217]<ERR>Queue Create Failed. Invalid Queue Key[-1]
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,217]<ERR>Queue Create Failed. Invalid Queue Key[1215752192]
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,224]<ERR>Queue Create Failed. Invalid Queue Size!! Size[1215752192]
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,283][3]<INF>Queue Create Success!! Input Key[494949], Size[10000] => Created Key[494949], Id[4685827], Size[10000]
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,283][3]<INF>Queue Create Success!! Input Key[494949], Size[10000] => Created Key[494949], Id[4718595], Size[10000]
[22:17:29.537][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,84][3]<INF>Queue Write. Id[4718595],Type[0],Buf[THIS IS TEST],Size[5]
[22:17:29.538][/home/jonathan/workspace/19.Projects/CUTE/source/nxlib/common/queue.c,195][1]<WriteQueue>msgsnd error:-1, 22(Invalid argument)
[22:17:29.538][/home/jonathan/workspace/19.Projects/CUTE/source/nxlib/common/queue.c,196][1]<WriteQueue>Info Id[4718595], Type[0], Data[THIS ], Len[5], Ret[-1]
[22:17:29.538][/home/jonathan/workspace/19.Projects/CUTE/source/oxdsagent/queuectl.cpp,88]<ERR>Queue Write Failed!
로그 내용이다.. 문제가 생기는 부분은 마지막 부분의 <WriteQueue>msgsnd error:-1, 22(Invalid argument) 부분.
전혀 문제가 발생할 부분이 없는데 문제가 발생해서 한참을 헤매다가 겨우답을 찾았다.
msgsnd 의 맨페이지에서 답을 찾을 수 있었다.
DESCRIPTION
The msgsnd() and msgrcv() system calls are used, respectively, to send messages to, and receive messages from, a message queue. The calling process must have write permission on the
message queue in order to send a message, and read permission to receive a message.
The msgp argument is a pointer to caller-defined structure of the following general form:
struct msgbuf {
long mtype; /* message type, must be > 0 */
char mtext[1]; /* message data */
};
The mtext field is an array (or other structure) whose size is specified by msgsz, a nonnegative integer value. Messages of zero length (i.e., no mtext field) are permitted. The mtype
field must have a strictly positive integer value. This value can be used by the receiving process for message selection (see the description of msgrcv() below).
문제는 메시지 큐 타입을 ‘0’으로 하고 msgsnd를 호출 했던 것…
맨페이지에 명확하게 적혀 있었다.”/* message type, must be > 0 */” …. 아..;;
큐 타입을 1로 하고 호출하자 정상 작동 되었다.