Sponsored Content
Top Forums Programming Client accidently close when the server crash Post 302521000 by sehang on Tuesday 10th of May 2011 01:12:51 AM
Old 05-10-2011
Client accidently close when the server crash

The steps to test the problem
1. Open TCP Server
2. Open TCP Client
3. TCP Client sends data to Server.
4. Close TCP Server and the client also crash without any notification

Second wonderful test:
1. Comment the following statement in Client.c (at line 168) and compile it
Code:
Writen( sockfd, data.send_buf, strlen( data.send_buf ), __FILE__, __LINE__ );

2. Run TCP Server
3. Run TCP Client (since no writen(), so response from server, it is OK)
4. Close TCP Server
5. A lot of rubbish from TCP Server.........




I also posted the source code here.
Compile TCP Server
Code:
gcc -Wall -lmcheck -g -Werror -lpthread -o server server.c

Compile TCP Client
Code:
gcc -Wall -lmcheck -g -Werror -lpthread -o client Client.c lib/*.c

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

linux server crash

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

server crash

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

Solaris Server Crash

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

crash dump server for red hat ent 4

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

Client/Server Socket Application - Preventing Client from quitting on server crash

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

Crash error on my unix server

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

how to configure netdump to copy the crash in the server itself??

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

[C] close server after user input

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

Ssh to Solaris 10 server - close connection

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

Script to collect log files in case of server crash

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
Net::Server::Proto::TCP(3)				User Contributed Perl Documentation				Net::Server::Proto::TCP(3)

NAME
Net::Server::Proto::TCP - Net::Server TCP protocol. SYNOPSIS
See Net::Server::Proto. DESCRIPTION
Protocol module for Net::Server. This module implements the SOCK_STREAM socket type under INET (also known as TCP). See Net::Server::Proto. PARAMETERS
There are no additional parameters that can be specified. See Net::Server for more information on reading arguments. INTERNAL METHODS
"object" Returns an object with parameters suitable for eventual creation of a IO::Socket::INET object listining on UDP. "log_connect" Called before binding the socket to provide useful information to the logs. "connect" Called when actually binding the port. Handles default parameters before calling parent method. "reconnect" Called instead of connect method during a server hup. "accept" Override of the parent class to make sure necessary parameters are passed down to client sockets. "poll_cb" Allow for psgi compatible interface during HTTP server. "read_until" Takes a regular expression, reads from the socket until the regular expression is matched. "hup_string" Returns a unique identifier that can be passed to the re-exec'ed process during HUP. "show" Basic dumper of properties stored in the glob. "AUTOLOAD" Handle accessor methods. LICENCE
Distributed under the same terms as Net::Server perl v5.18.2 2013-01-09 Net::Server::Proto::TCP(3)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy