05-12-2011
I'm glad that I won't end-up maintaining your code...
I played with it a bit, took me some time to get the client working without crash:
- A Pthread_attr_init is missing for rx (Client.c:218)
- Your client must be aware that a server may close the TCP connection brutally (RST segment). In this case, you'll get 0 on read() or SIGPIPE on the next write(). The way you usually get around this is to ignore SIGPIPE and watch for errno EPIPE when write() fails.
- There is likely more problems with your code.
HTH, Loïc
This User Gave Thanks to Loic Domaigne For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi
I faced a problem while booting linux which is as follows;-
*************************************************
Inode 146180 has illegal block(s)
xauth:error in locking authority file /home/root/.Xauthority
Fatal Server Error:
Could not create lock file in /tmp/tXo-lock
... (1 Reply)
Discussion started by: Abhishek
1 Replies
2. UNIX for Dummies Questions & Answers
Our SUn Solaris Server has crashed second time in 2 days, reason is not known , we are trying to determine what could have gone wrong, any ideas, the power supply seems to be fine, there is no response from keyboard,monitor etc and we had to do a hot boot yesterday..
Any suggestions what could be... (9 Replies)
Discussion started by: knarayan
9 Replies
3. UNIX for Advanced & Expert Users
We have had a server (Solaris 2.6) hardisk crash. When booting the server we get:
ok> boot -S
Boot Device: /sbus/espdmc@e, 8400000/esp@e,8800000/sd@0,0
short read 0x2000 chars read
disk read error
The only way we can get into the console is to
ok> boot cdrom
whereby everything (e.g.... (3 Replies)
Discussion started by: Breen
3 Replies
4. Linux
Is it true that you can't have the crash dump server/client on the same server?
I know I've installed Nagios open source before, I though it's only for that kind of thing. I never though that Red hat ent 4 would be like client/server on the crash dump.
if someone is having problem with high... (0 Replies)
Discussion started by: itik
0 Replies
5. Programming
Problem
- Linux Client/Server Socket Application: Preventing Client from quitting on server crash
Hi,
I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64.
I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies
6. SCO
Hi there.
Well i have a really bad problem with my server:
UnixWare Version 5 Release 7
The system crash :wall: and show the error:
Panic: Kernel-mode address fault on user address 0x00000004 :eek:
If anyone knows about the reason of this error please give me a help
Sorry by my english.... (3 Replies)
Discussion started by: danilosevilla
3 Replies
7. Red Hat
hi,
i would like to configure netdump, but saving the var/crash in the server itself, not in another server.
could anybody tell me if this is possible?
thanks (4 Replies)
Discussion started by: pabloli150
4 Replies
8. Programming
i must close server after a specific user input, such as FINE, if i put a test inside function "maiuscolatore" i receive an error on second recv of client. why?
below there are code of client and server:
CLIENT:
#include <stdlib.h>
#include <stdio.h>
#include... (0 Replies)
Discussion started by: tafazzi87
0 Replies
9. Solaris
Can ssh to server. Asks for password.
Then seems to time out and close the connection. Any ideas?
---------- Post updated at 09:30 AM ---------- Previous update was at 07:51 AM ----------
Here is output from ssh -vvv -l user <IPaddress>
debug3: packet_send2: adding 64 (len 59 padlen 5... (4 Replies)
Discussion started by: psychocandy
4 Replies
10. UNIX for Dummies Questions & Answers
Environmnet: HP-UX B.11.31 U ia64
RDBMS: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
Question:
When server hangs or node evicts, we open up tickets with Oracle Support and Oracle Support ask for some list of log files.
Currently we can not use the... (2 Replies)
Discussion started by: Siva SQL
2 Replies
LEARN ABOUT DEBIAN
io_trywrite
io_trywrite(3) Library Functions Manual io_trywrite(3)
NAME
io_trywrite - write to a descriptor without blocking
SYNTAX
#include <io.h>
int io_trywrite(int64 fd,const char* buf,int64 len);
DESCRIPTION
io_trywrite tries to write len bytes of data from buf[0], buf[1], ..., buf[len-1] to descriptor fd. (The effects are undefined if len is 0
or smaller.) There are several possible results:
o o_trywrite returns an integer between 1 and len: This number of bytes was immediately written from the beginning of buf. Note that this
number can be, and often is, smaller than len; you must not assume that io_trywrite always succeeds in writing exactly len bytes.
o io_trywrite returns -1, setting errno to EAGAIN: No bytes were written, because the descriptor is not ready. For example, the descriptor
is writing to a full pipe that could still be read.
o io_trywrite returns -3, setting errno to something other than EAGAIN: No bytes were written, because the write attempt encountered a
persistent error, such as a serious disk failure (EIO), an unreachable network (ENETUNREACH), or an invalid descriptor number (EBADF).
io_trywrite does not pause waiting for a descriptor that is not ready. If you want to pause, use io_waitread or io_wait.
You can make io_trywrite faster and more efficient by making the socket non-blocking with io_nonblock().
Once upon a time, many UNIX programs neglected to check the success of their writes. They would often encounter EPIPE, and would blithely
continue writing, rather than exiting with an appropriate exit code. The UNIX kernel developers decided to send a SIGPIPE signal, which
terminates the process by default, along with returning EPIPE. This papers over the problem without fixing it: the same programs ignore
other errors such as EIO. One hopes that the programs have been fixed by now; kernels nevertheless continue to generate the SIGPIPE signal.
The first time io_trywrite or io_waitwrite is called, it arranges for SIGPIPE to be ignored. (Technically, for SIGPIPE to be caught by an
empty signal handler, so this doesn't affect child processes.) Do not use SIGPIPE elsewhere in the program.
SEE ALSO
io_nonblock(3), io_waitread(3), io_trywritetimeout(3)
io_trywrite(3)