03-21-2007
zen,
i doubt if you could use select() for the the different message queues, while you can do that for sockets. If you have multiple sockets and need to do event based handling depending on which socket you recv and what type of message you get, sockets are the ay to go. But the point to note is that its reliable, if you are pushing UDP packets internally within the system.
10 More Discussions You Might Find Interesting
1. Programming
Hi all,
I've been trying for hours to figure out how to turn my 2-program (one to send and one to receive) "chat system" using message queues, into a single program where each concurrent component (entity) will both send and receive messages. PLEASE give me a hand with this, I'm starting to... (9 Replies)
Discussion started by: mgchato
9 Replies
2. UNIX for Dummies Questions & Answers
let 3 processes a, b and c are sharing msgs using msg queues.process 'a' sending msg to 'c' and in turn 'c' send sthat msg to 'b'.if something happens to c how can 'a' and 'b' know that 'c' is not available?????? (2 Replies)
Discussion started by: sukaam
2 Replies
3. Solaris
We have message queues created from our ERP system to our tax system via an application api written by the ERP software vendor.
Occasionally when a user does not gracefully exit the ERP application, the message queue hangs. After a few months, this becomes a problem as the queues are all used... (2 Replies)
Discussion started by: MizzGail
2 Replies
4. Linux
how to check the maximun number of message queues in current linux enviornment? is there any command ? (4 Replies)
Discussion started by: princelinux
4 Replies
5. Programming
Hi,
According to my understanding..
When message queues are used, when a process post a message in the queue and if another process reads it from the queue then the queue will be empty unlike shared memory where n number of processess can access the shared memory and still the contents remain... (2 Replies)
Discussion started by: rvan
2 Replies
6. UNIX for Advanced & Expert Users
#include <sys/ipc.h>
#include <sys/msg.h>
int main()
{
int qid;
int t;
struct msgbuf mesg;
qid=msgget(IPC_PRIVATE,IPC_CREAT);
mesg.mtype=1L;
mesg.mtext=1;
t=msgsnd(qid,&mesg,1,0);
printf("%d",t);
}
the program prints -1 as the result of msgsnd ,which means that msgsnd doesn't... (1 Reply)
Discussion started by: tolkki
1 Replies
7. UNIX for Dummies Questions & Answers
can any body provide a tutorial that explains the concept of message queues in UNIX in great detail (1 Reply)
Discussion started by: asalman.qazi
1 Replies
8. Programming
Hi,
I have searched the forums and could not find a relavant thread discussing my use case, hence the new post.
Basically am trying to pass on work to dummy worker instances from controller which will pass on work to workers (client)
To make use of host capacity, am planning to serialize... (2 Replies)
Discussion started by: matrixmadhan
2 Replies
9. Shell Programming and Scripting
i have an application installed on AIX 5.3 and i have made a script that shutdown a proccesses that exceeded 10000kb of memory usage but i have a problem with cleaning the message queues of these proccesses after shutting them down. Is there any way to clean the message queues for this particular... (8 Replies)
Discussion started by: Portabello
8 Replies
10. UNIX for Advanced & Expert Users
i have a program(C++ Code) that sends/receives information through queue's (Uses MQ)
Is there any UNIX/LINUX tool that calculates the load and performance time for the same.
If not how do i design the program that calculates the performance time.
i know that time.h can be used but it gives... (2 Replies)
Discussion started by: vkca
2 Replies
UDP(7P) UDP(7P)
NAME
UDP - Internet User Datagram Protocol
SYNOPSIS
DESCRIPTION
UDP is a simple, unreliable datagram protocol used to support the socket type for the internet protocol family. UDP sockets are connec-
tionless, and are normally used with the and calls (see send(2) and recv(2). The call can also be used to simulate a connection (see con-
nect(2). When used in this manner, it fixes the destination for future transmitted packets (in which case the or system calls can be
used), as well as designating the source from which packets are received. The and calls can be used at any time if the source of the mes-
sage is unimportant.
UDP address formats are identical to those used by TCP. In particular, UDP requires a port identifier in addition to the normal Internet
address format. Note that the UDP port domain is separate from the TCP port domain (in other words, a UDP port cannot be connected to a
TCP port).
The default send buffer size for UDP sockets is 65535 bytes. The default receive buffer size for UDP sockets is 2147483647 bytes. The
send and receive buffer sizes for UDP sockets can be set by using the and options of the system call or the and options of the system call.
The maximum size for these buffers is 2147483647 bytes. The maximum receive buffer size may be lowered using the parameter
The maximum message size for a UDP datagram socket is limited by the lesser of the maximum size of an IP datagram and the size of the UDP
datagram socket buffer. The maximum size of an IP datagram limits the maximum message size of a UDP message to 65507 bytes. Therefore,
using the maximum socket buffer size will allow multiple maximum-sized messages to be placed on the send queue. The default inbound and
outbound message size limit for a UDP datagram socket is 65535 bytes.
The maximum message size for a UDP broadcast is limited by the MTU size of the underlying link.
ERRORS
One of the following errors may be returned in if a socket operation fails. For a more detailed list of errors, see the man pages for spe-
cific system calls.
[EISCONN] Attempt to send a datagram with the destination address specified, when the socket is already connected.
[ENOBUFS] No buffer space is available for an internal data structure.
[EADDRINUSE] Attempt to create a socket with a port which has already been allocated.
[EADDRNOTAVAIL] Attempt to create a socket with a network address for which no network interface exists.
AUTHOR
The socket interfaces to UDP were developed by the University of California, Berkeley.
SEE ALSO
ndd(1M). getsockopt(2), recv(2), send(2), socket(2), t_open(3), t_optmgmt(3) inet(7F), socket(7),
RFC 768 User Datagram Protocol
RFC 1122 Requirements for Internet hosts
UDP(7P)