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
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
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
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
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
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
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
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
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
SET_NET_DEFAULT(8) System Manager's Manual SET_NET_DEFAULT(8)
NAME
s_n_d, set_net_default - select the default TCP/IP network
SYNOPSIS
set_net_default: not found
DESCRIPTION
This manual page is here because so many others refer to it. The set_net_default command does not exist under standard Minix, because the
TCP/IP server only supports one network. The server under Minix-vmd supports four different networks, that can each be chosen as the
default network.
The TCP/IP library and commands do have a notion about a "default network" however, because the code is shared between the Minix versions.
So if you want to venture into network programming then you should know about the devices and environment variables mentioned below to make
your program compatible. (Especially since there is a plan to upgrade the TCP/IP server for standard Minix.)
Options and environment to change the default
Many TCP/IP programs implement the following options and environment variables to change the default devices set by set_net_default. The
options are only implemented for low level programs where it makes sense to name a network device. The environment variables are used in
all code. You can run a process and all its children connected to a different network by setting four environment variables.
ETH_DEVICE=device
-E device
Device to use as raw ethernet device instead of the default /dev/eth.
PSIP_DEVICE=device
-P device
Pseudo IP device to use instead of /dev/psip.
IP_DEVICE=device
-I device
IP device to use instead of /dev/ip.
TCP_DEVICE=device
-T device
TCP device to use.
UDP_DEVICE=device
-U device
UDP device to use.
FILES
/dev/eth[01] First and second raw ethernet.
/dev/psip[01] First and second Pseudo IP network.
/dev/ip[0123] IP devices for two ethernets and two Pseudo IP networks.
/dev/tcp[0123] TCP devices for same four networks.
/dev/udp[0123] UDP devices.
/dev/eth, /dev/psip, /dev/ip, /dev/tcp, /dev/udp
Devices for the default network, links to the devices above. Eth is only present if ethernet is the default, psip only
for pseudo IP.
SEE ALSO
ip(4), boot(8).
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
SET_NET_DEFAULT(8)