04-04-2010
Quote:
Originally Posted by
kedah160
i'm doing a simple program in socket programming on c i have server that can handle 2clients in a single machine i'm running ubuntu linux so i got it work but the probelm when clients send a message the server will echo it but i cant distinguish which client send the message client 1 or client 2 here is the code for the server whenever a client sent a message it will be shown in the server side as( client sent : hi)i cant know which client sent it please help
With
getpeername()?
10 More Discussions You Might Find Interesting
1. Programming
Dear Reader,
Is there any way to check up socket status other than 'netstatus '
Thanks in advance, (1 Reply)
Discussion started by: joseph_shibu
1 Replies
2. Programming
Hello,
I actually try to make client-server program.
I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error :
I'm just using this simple code :
and I get the same error if I use :
If someone can help me,
Thanks (2 Replies)
Discussion started by: soshell
2 Replies
3. Programming
Can anyone plz me. I need a sample code for the following description.
Its urgent.
It is C/Socket program with the following descriptions:
NAME
coreadServer - Concurrent Readers Server.
coreadClient - Concurrent Readers Client.
SYNOPSIS
coreadServer <OutputFile>
coreadClient <n>... (1 Reply)
Discussion started by: priya.vmr
1 Replies
4. IP Networking
my system is a stand alone system... i want to try doing socket porgramming..ihave heard that this is usually done during testing...
how can i do that....? (6 Replies)
Discussion started by: damn_bkb
6 Replies
5. IP Networking
Hello Everyone
Iam working on tcp/ip programming.with some time interval server has to send data.client has to close the connection and to open the connection between the time interval.this is the scenario
when iam closing the connection in client side the connection terminates.how to... (1 Reply)
Discussion started by: sureshvaikuntam
1 Replies
6. Programming
i m using sockets for setting up a connection between a server and a client.
When the clients gets connected to the server, its ip is conveyed to the server through one of the predefined structures in c library...
i save this ip address in an array....1st client's ip address goes to the zeroth... (1 Reply)
Discussion started by: abmxla007
1 Replies
7. UNIX for Advanced & Expert Users
can we send udp message to a destination ip address .. without having an ip address configured in our machine using recvfrom ? (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies
8. UNIX for Dummies Questions & Answers
in socket programming how can i : Create for example 3 blank files, namely: server, client, network
•Server: act as servers/provider, will receive all requests from different client
•Client: requesters
•Network: middle-layer of communication between server & client
any tips or... (6 Replies)
Discussion started by: kedah160
6 Replies
9. Programming
Hi everyone,
I'm new to this forum. I'm working on new project for last few days and this forum already helped me on
couple of occasions. I don't have any prior experience with network programming so I'll appreciate any advise given.
I'm trying to do the following:
1. open user... (2 Replies)
Discussion started by: _thomas
2 Replies
10. Programming
how to include socket.h in visual studio 2005.. (2 Replies)
Discussion started by: asd123
2 Replies
nfs(7) Miscellaneous Information Manual nfs(7)
NAME
nfs, NFS - network file system
DESCRIPTION
The Network File System (NFS) allows a client node to perform transparent file access over the network. By using NFS, a client node oper-
ates on files residing on a variety of servers and server architectures, and across a variety of operating systems. File access calls on
the client (such as read requests) are converted to NFS protocol requests and sent to the server system over the network. The server
receives the request, performs the actual file system operation, and sends a response back to the client.
NFS operates in a stateless manner using remote procedure calls (RPC) built on top of an external data representation (XDR) protocol. The
RPC protocol enables version and authentication parameters to be exchanged for security over the network.
A server grants access to a specific file system to clients by adding an entry for that file system to the server's file.
A client gains access to that file system using the command to request a file handle for the file system (see mount(1M)). (A file handle
is the means by which NFS identifies remote files.) Once a client mounts the file system, the server issues a file handle to the client
for each file (or directory) the client accesses. If the file is removed on the server side, the file handle becomes stale (dissociated
with a known file), and the server returns an error with set to
A server can also be a client with respect to file systems it has mounted over the network; however, its clients cannot directly access
those file systems. If a client attempts to mount a file system for which the server is an NFS client, the server returns with set to The
client must mount the file system directly from the server on which the file system resides.
The user ID and group ID mappings must be the same between client and server. However, the server maps UID 0 (the superuser) to UID -2
before performing access checks for a client. This process prevents gaining superuser privileges on remote file systems.
RETURN VALUE
Generally, physical disk I/O errors detected at the server are returned to the client for action. If the server is down or inaccessible,
the client receives the message:
where is the hostname of the NFS server. The client continues resending the request until it receives an acknowledgement from the server.
Therefore, the server can crash or power down, and come back up without any special action required by the client. The client process
requesting the I/O will block, but remains sensitive to signals (unless mounted with the option) until the server recovers. However, if
mounted with the option, the client process returns an error instead of waiting indefinitely.
AUTHOR
was developed by Sun Microsystems, Inc.
SEE ALSO
exportfs(1M), share(1M), mount(1M), mount_nfs(1M), nfsd(1M), mount(2), fstab(4), dfstab(4).
nfs(7)