Sponsored Content
Special Forums IP Networking How to handle unplugging ethernet cable in socket programming Post 302395084 by JagadishB on Monday 15th of February 2010 12:52:40 AM
Old 02-15-2010
How to handle unplugging ethernet cable in socket programming

Hi, I am trying to implement a server-client socket communication. My server and clients are in different PCs. During communications if the ethernet cable is removed from the server side it shows broken pipe due to unable to write on the socket. I want to know how to check whether the ethernet cable is plugged or not before trying to write on socket. Is there any API to check ethernet connectivity that can be used in socket programming?? How can I check a socket is alive or not ??

Last edited by JagadishB; 02-19-2010 at 01:19 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

Socket 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

Socket Programming socket

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

Socket Programming

Hi , I'm facing the following problem in socket programming. My structure is struct { int i; char *str; }samp; I'm creating the pointer to this structure and assigning the value to the structure members and send via the socket to the another process. The receiver process when... (7 Replies)
Discussion started by: arunviswanath
7 Replies

4. Red Hat

[RHEL4.5] server shutdown when I unplug the ethernet cable

hi.. I unplug my eth0 lan cable.. and suddenly my system shutdown... no idea :eek::confused: (3 Replies)
Discussion started by: flekzout
3 Replies

5. Programming

Help with socket programming in C

hi guys i got this code trying to make connection between the server and multi clients but when i do ./server i got message server waiting then when i run ./client it says client 1 nosuch file i dont know whats that should i use any argument plz help how to compile and run and whats the expected... (1 Reply)
Discussion started by: kedah160
1 Replies

6. IP Networking

Two Servers via ethernet crossover cable

Hi, I'm trying to communicate two servers (HP DLProliant 380 G5) via a crossover cable, but I don't get them to ping each other. I am working in RHEL 4. These are the steps I've performed: 1) Plugged the crossover cables in eth2. (note: The cable is brand new. Also I built one myself... (3 Replies)
Discussion started by: jrodriguez365
3 Replies

7. Programming

Socket 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

8. UNIX for Dummies Questions & Answers

How to change ethernet cable of iscsi initiator (iscsi client)?

how to change ethernet cable of iscsi initiator (iscsi client) (0 Replies)
Discussion started by: pankajd
0 Replies

9. Programming

How detect TCP/IP socket shutdown when ethernet cable is disconnected

Hi, I want to code TCP/IP client/server in linux application capable to fastly detect ethernet cable disconnection in any condition. So I have activate SO_KEEPALIVE options and set TCP_KEEPCNT, TCP_KEEPIDLE and TCP_KEEPINTVL to 1. When I disconnect ethernet cable I have the following... (5 Replies)
Discussion started by: jeje_clb
5 Replies

10. AIX

How to detect the network cable status with c programming on AIX

Hello, Is there any API or any other approach to detect whether the network cable is connected to the network adapter, say, en0, en1 or en2? The OS is AIX6.1. Thank you. (4 Replies)
Discussion started by: zephyrbj
4 Replies
rpc_alloc_handle(3ncs)													    rpc_alloc_handle(3ncs)

Name
       rpc_alloc_handle - create an RPC handle (client only)

Syntax
       #include <idl/c/rpc.h>

       handle_t rpc_$alloc_handle(object, family, status)
       uuid_$t *object;
       unsigned long family;
       status_$t *status;

Arguments
       object		   The UUID of the object to be accessed.  If there is no specific object, specify uuid_$nil.

       family		   The address family to use in communications to access the object.  Currently, only socket_$ internet is supported.

       status		   The completion status.  If the completion status returned in is equal to status_$ok , then the routine that supplied it
			   was successful.

Description
       The routine creates an unbound RPC handle that identifies a particular object but not a particular server or host.

       If a remote procedure call is made using the unbound handle, it will effect a broadcast to all Local Location Brokers (LLBs) on	the  local
       network.   If  the call's interface and the object identified by the handle are both registered with any LLB, that LLB forwards the request
       to the registering server.  The client RPC runtime library returns the first response that it receives and binds the handle  to	the  first
       responding server.

Examples
       The following statement allocates a handle that identifies the Acme company's payroll database object:
       h = rpc_$alloc_handle (&acme_pay_id, socket_$internet, &status);

Diagnostics
       This section lists status codes for errors returned by this routine in

       rpc_$comm_failure   The client was unable to get a response from the server.

       rpc_$unk_if	   The	requested interface is not known.  It is not registered in the server, the version number of the registered inter-
			   face is different from the version number specified in the request, or the UUID in the request does not match the  UUID
			   of the registered interface.

       rpc_$cant_create_sock
			   The RPC runtime library was unable to create a socket.

       rpc_$cant_bind_sock The RPC runtime library created a socket but was unable to bind it to a socket address.

       rpc_$wrong_boot_time
			   The	server	boot  time value maintained by the client does not correspond to the current server boot time.	The server
			   was probably rebooted while the client program was running.

       rpc_$not_in_call    An internal error.

       rpc_$you_crashed    This error can occur if a server has crashed and restarted.	A client RPC runtime library sends the error to the server
			   if  the  client  makes  a  remote  procedure  call before the server crashes, then receives a response after the server
			   restarts.

       rpc_$proto_error    An internal protocol error.

Files
See Also
       intro(3ncs), rpc_free_handle(3ncs), rpc_set_binding(3ncs)

															    rpc_alloc_handle(3ncs)
All times are GMT -4. The time now is 10:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy