Sponsored Content
Top Forums Shell Programming and Scripting Alternative network messaging? Post 302720743 by DGPickett on Wednesday 24th of October 2012 02:51:25 PM
Old 10-24-2012
Polling is an architectural choice. If the originators have a subscription list or a common destination, they can push. Polling is about pulling information that may not exist yet. Then there are signals, which shells can send with kill and receive with trap. Two signals are reserved for app use. Signals allow for interrupt driven processing, which is a sort of push, in that the originator pushes a signal. The master can process signals one at a time so no chaos erupts. However, the signal is pretty bare, does not tell you who is calling, so you need a per sender message file, even as just a flag, that is only polled on interrupt. That's nicer than polling in a tight loop wasting and destroying resources, or sleeping and ignoring new data. There is often a little poll under an interrupt. You could have the message files be queued in a special directory, named uniquely, so on interrupt the master processes each and then deletes it. The file name or content may just tell the master where to go for the full message, or may be the full message. Files can be composed elsewhere on that file system or in that dir but with a filtering extension, and mv'd when complete, so there is no race condition. Directories provide all the necessary locking and list management for multiple simultaneous writers. Exploit them.
This User Gave Thanks to DGPickett For This Post:
 

6 More Discussions You Might Find Interesting

1. Programming

Instant Messaging App Help

I was hoping someone could assist me on a text-based instant messaging client(using UDP) I am working on. I have the network communication basics already in place but, specifically, needed some further help on the "messaging other users" and "getting a user list" functions. The server code that... (0 Replies)
Discussion started by: AusTex
0 Replies

2. IP Networking

DT messaging could not be started

this id the message i get with a suggestions to check those files: /etc/src.sh /etc/hosts /usr/adm/inetd.sec i have little knowledge of hoe to edit those files/ i went to the etc library and didn't found src.sh file. what should i do? also didn't find the inetd.sec file In the host... (3 Replies)
Discussion started by: amirp
3 Replies

3. UNIX and Linux Applications

how do i enable messaging

hi guyz i work as a system administrator for some organization(am a newbie). one of the solaris machines is loaded with the messenger server...all configured by a former administrator. my task was to create user accounts for the mail and calendar services and as i checked its not working .....i... (0 Replies)
Discussion started by: henokia4j
0 Replies

4. Programming

problems while using messaging queues....

hi I am using posix functions such as mq_open, mq_close and including the mqueue.h. but its giving a linking error,"undefined reference to mq_open and mq_close". it it that we have to link some library or so while compiling... plzzz help Thanxs Mohit (0 Replies)
Discussion started by: mohit3884
0 Replies

5. UNIX for Advanced & Expert Users

The DT messaging system could not be started

Hello All, I am getting " The DT messaging system could not be started" message when wants to login as root on a box running on tru64 5.1A. /etc/hosts is ok. when i see in .dt/errorlog it shows message server could not be started. Thanks for help. Awadhesh (2 Replies)
Discussion started by: Awadhesh
2 Replies

6. Shell Programming and Scripting

The DT messaging system could not be started.

Good Morning, Users can no longer log into SunBlade 2500 Solaris 9 system (though root still can). Here's what I'm getting and what I've done. I'm most suspicious of the full drive since that pops up twice and I did see one looks full. What's a good way to reduce what's on it?- or.. what else... (2 Replies)
Discussion started by: Stellaman1977
2 Replies
SIGNAL(3)						   BSD Library Functions Manual 						 SIGNAL(3)

NAME
signal -- simplified software signal facilities LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <signal.h> void (* signal(int sig, void (*func)(int)))(int); DESCRIPTION
This signal() facility is a simplified interface to the more general sigaction(2) facility. Signals allow the manipulation of a process from outside its domain as well as allowing the process to manipulate itself or copies of itself (children). There are two general types of signals: those that cause termination of a process and those that do not. Signals which cause termination of a program might result from an irrecoverable error or might be the result of a user at a terminal typing the `interrupt' char- acter. Signals are used when a process is stopped because it wishes to access its control terminal while in the background (see tty(4)). Signals are optionally generated when a process resumes after being stopped, when the status of child processes changes, or when input is ready at the control terminal. Most signals result in the termination of the process receiving them if no action is taken; some signals instead cause the process receiving them to be stopped, or are simply discarded if the process has not requested otherwise. Except for the SIGKILL and SIGSTOP signals, the signal() function allows for a signal to be caught, to be ignored, or to generate an interrupt. See signal(7) for comprehensive list of supported signals. The func procedure allows a user to choose the action upon receipt of a signal. To set the default action of the signal to occur as listed above, func should be SIG_DFL. A SIG_DFL resets the default action. To ignore the signal func should be SIG_IGN. This will cause subse- quent instances of the signal to be ignored and pending instances to be discarded. If SIG_IGN is not used, further occurrences of the signal are automatically blocked and func is called. The handled signal is unblocked when the function returns and the process continues from where it left off when the signal occurred. Unlike previous signal facilities, the handler func() remains installed after a signal has been delivered. For some system calls, if a signal is caught while the call is executing and the call is prematurely terminated, the call is automatically restarted. (The handler is installed using the SA_RESTART flag with sigaction(2)). The affected system calls include read(2), write(2), sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communications channel or a low speed device and during a ioctl(2) or wait(2). How- ever, calls that have already committed are not restarted, but instead return a partial success (for example, a short read count). When a process which has installed signal handlers forks, the child process inherits the signals. All caught signals may be reset to their default action by a call to the execve(2) function; ignored signals remain ignored. Only functions that are async-signal-safe can safely be used in signal handlers, see signal(7) for a complete list. RETURN VALUES
The previous action is returned on a successful call. Otherwise, SIG_ERR is returned and the global variable errno is set to indicate the error. ERRORS
signal() will fail and no action will take place if one of the following occur: [EINVAL] Specified sig is not a valid signal number. [EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or SIGSTOP. SEE ALSO
kill(1), kill(2), ptrace(2), sigaction(2), sigaltstack(2), sigprocmask(2), sigsuspend(2), psignal(3), setjmp(3), strsignal(3), tty(4), signal(7) HISTORY
This signal() facility appeared in 4.0BSD. BSD
June 11, 2004 BSD
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy