Thread: msgsnd : Invalid argument

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    9

    msgsnd : Invalid argument

    G'day, everyone!

    My another issue is the following.

    I have a server-client program that makes use of the message queues: clients communicate with each other centralizedly through the server; obviously, they use the same queue. Kind of a local instant messaging service with a basic set of functions. In the beginning the client registers and the server sends it a confirmation.

    It works pretty well when I run it on my computer. But when I tried to execute it on the other system and send a message from the server, I immedeately got it crashed with the following error:

    Code:
    msgsnd : Invalid argument
    This is what I got when I STFW'd

    Two conditions can cause that error:
    1. message queue identifier is not valid
    2. message length is less than zero
    But:

    1. the client DOES register at server, therefore it uses msgsnd() successfully; the server uses the same queue; yet, the program crashes as soon as server attempts to use msgsnd(). I use my own header as an argument for ftok();
    2. the content of message is just fine.

    I don't get it. My question is, what could change when I switched from one system to the other?

    Thanks in advance!
    Last edited by Krusty; 09-10-2009 at 11:53 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Nested loop frustration
    By caroundw5h in forum C Programming
    Replies: 14
    Last Post: 03-15-2004, 09:45 PM
  5. Flood of errors when include .h
    By erik2004 in forum C++ Programming
    Replies: 14
    Last Post: 12-07-2002, 07:37 AM