Sponsored Content
Top Forums Programming I am a little bit confused in a socket example through select() Post 302506848 by disaster on Tuesday 22nd of March 2011 06:12:24 AM
Old 03-22-2011
To be honest, I do not really understand your question.
What exactly is the problem?

Just a quick thing about your code changes: They would not change anything except for the puts().
read() returns either -1 on error or the number of bytes read. The -1 case will call err_sys which will exit the whole program. So Read() will always return something >= 0
 

8 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Programming

Anyone know how to use socket select() function?

hello socket programming expert, I having difficulties in understanding how select() function in socket programming work.... I'm trying to create my own peer-to-peer chat or file transfer program by using the select() function.... Therefore does anyone had any tutorial or source code that... (4 Replies)
Discussion started by: draggy
4 Replies

3. Programming

Multiplexing socket and message queue using Select()

I have a socket and a message queue over which i am trying to multiplex input using select(). When data comes over socket the select works but when it comes over message queue the select is not detecting it . Create_Q gets the identifier of the messege queue. ... (1 Reply)
Discussion started by: shaurya.rastogi
1 Replies

4. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

5. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

6. Programming

Socket and select

I have created two sockets and binded both. My requirement is that 2nd socket must send/ recv data only on expiration of timeval(tv). but the 1st socket must keep on send/recv the data without waiting for the 2nd socket completion...... I have posted my code below...... In this code the 2nd... (3 Replies)
Discussion started by: naresh046
3 Replies

7. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies

8. UNIX for Beginners Questions & Answers

Is this sort working as it is supposed to be? A bit confused whether it is sorting correctly or not

Hi, Below is the sample file: $ cat x.txt MDSYS|OGIS_GEOMETRY_COLUMNS|TABLE MDSYS|OGIS_SPATIAL_REFERENCE_SYSTEMS|TABLE MDSYS|SDO_IDX_TAB_SEQUENCE|SEQUENCE MDSYS|SDO_PREFERRED_OPS_USER|TABLE MDSYS|SDO_ST_TOLERANCE|TABLE MDSYS|SDO_TOPO_DATA$|TABLE MDSYS|SDO_TOPO_RELATION_DATA|TABLE... (4 Replies)
Discussion started by: newbie_01
4 Replies
explain_puts_or_die(3)					     Library Functions Manual					    explain_puts_or_die(3)

NAME
explain_puts_or_die - write a string and a newline to stdout and report errors SYNOPSIS
#include <libexplain/puts.h> void explain_puts_or_die(const char *s); int explain_puts_on_error(const char *s); DESCRIPTION
The explain_puts_or_die function is used to call the puts(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_puts(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_puts_on_error function is used to call the puts(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_puts(3) function, but still returns to the caller. s The s, exactly as to be passed to the puts(3) system call. RETURN VALUE
The explain_puts_or_die function only returns on success, see puts(3) for more information. On failure, prints an explanation and exits, it does not return. The explain_puts_on_error function always returns the value return by the wrapped puts(3) system call. EXAMPLE
The explain_puts_or_die function is intended to be used in a fashion similar to the following example: explain_puts_or_die(s); SEE ALSO
puts(3) write a string and a trailing newline to stdout explain_puts(3) explain puts(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_puts_or_die(3)
All times are GMT -4. The time now is 01:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy