rpc_bind(3ncs)rpc_bind(3ncs)Name
rpc_bind - allocate an RPC handle and set its binding to a server (client only)
Syntax
#include <idl/c/rpc.h>
handle_t rpc_$bind(object, sockaddr, slength, status)
uuid_$t *object;
socket_$addr_t *sockaddr;
unsigned long slength;
status_$t *status;
Arguments
object The UUID of the object to be accessed. If there is no specific object, specify uuid_$nil.
sockaddr The socket address of the server.
slength The length, in bytes, of sockaddr.
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 a fully bound RPC handle that identifies a particular object and server. This routine is equivalent to an routine fol-
lowed by an routine.
Examples
The following statement binds the binop client to the specified object and socket address. The loc parameter is the result of a previous
call to which converted the host name and port number to a socket address.
rh = rpc_$bind (&uuid_$nil, &loc, llen, &status);
Diagnostics
This section lists status codes for errors returned by this routine in
rpc_$cant_bind_sock The RPC runtime library created a socket but was unable to bind it to a socket address.
rpc_$not_in_call An internal error.
rpc_$proto_error An internal protocol error.
FilesSee Alsointro(3ncs), rpc_clear_binding(3ncs), rpc_clear_server_binding(3ncs), rpc_set_binding(3ncs)rpc_bind(3ncs)
Check Out this Related Man Page
rpc_use_family(3ncs)rpc_use_family(3ncs)Name
rpc_use_family - create a socket of a specified address family for a remote procedure call (RPC) server (server only)
Syntax
#include <idl/c/rpc.h>
void rpc_$use_family(family, sockaddr, slength, status)
unsigned long family;
socket_$addr_t *sockaddr;
unsigned long *slength;
status_$t *status;
Arguments
family The address family of the socket to be created. The value must be one of socket_$internet or socket_$unspec.
sockaddr The socket address of the socket on which the server will listen.
slength The length, in bytes, of sockaddr.
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 a socket for a server without specifying its port number. The RPC runtime software assigns a port number. If a server
must listen on a particular well-known port, use to create the socket.
A server listens on one socket per address family, regardless of how many interfaces that it exports. Therefore, servers should make this
call once per supported address family.
Examples
The following statement creates a server's socket:
rpc_$use_family (family, &saddr, &slen, &status);
Diagnostics
This section lists status codes for errors returned by this routine in
rpc_$cant_create_sock
The RPC runtime library was unable to create a socket.
rpc_$not_in_call An internal error.
rpc_$proto_error An internal protocol error.
rpc_$too_many_sockets
The server is trying to use more than the maximum number of sockets that is allowed; it has called or too many times.
rpc_$addr_in_use The address and port specified in an routine are already in use. This is caused by multiple calls to with the same
well-known port.
FilesSee Alsointro(3ncs), rpc_use_family_wk(3ncs)rpc_use_family(3ncs)
Hello. I am havig problems with this program. It is a server supposed to get 2 integers from client, calculate a sum and send result back to client. I am getting a bind() error when attempting to execute it. Any help appreciated
#include <stdio.h>
#include <sys/types.h>
#include... (2 Replies)
suppose i want to pass object or structure using TCP/IP protocol
(using socket) then what are special steps required for passing the object from client to server and vice versa
Regards,
Amit (3 Replies)
HI
Can anyone provide me with codes for file transfer server to client or vice versa?
Also please explain how to compile those programs in ubuntu terminal as i am totally new to socket programming.
Thanks (0 Replies)