Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Socket programming:One server two port Post 302141050 by porter on Wednesday 17th of October 2007 12:32:04 PM
Old 10-17-2007
Use either select() or poll() to multiplex.

You basicall bind/listen on both and use select() to wait for a readable socket, select will tell you which one has activity on it, you can then read/write/accept etc after that. It's best to use non-blocking sockets.
 

10 More Discussions You Might Find Interesting

1. 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

2. IP Networking

socket programming

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

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. UNIX for Dummies Questions & Answers

socket programming : client server IPC

I'm new to socket programming. Have a basic doubt. I have a structure(global) at the server side. I have two different client connecting to the server. Will the changes made by one client on the structure be visible to the other client when it accesses the same client? I'm creating a STREAM... (3 Replies)
Discussion started by: abc.working
3 Replies

5. Programming

Socket programming

Hello!:) I'm trying to do some socket programming based on the following situation: I have a directory service named Casino that will hold all the information regarding the gamers that will try to connect to it in order to play a game(for example (Blackjack).Once they make the login they are... (4 Replies)
Discussion started by: maracumbigo
4 Replies

6. Programming

Socket Programming - Port Scanner. I Get Connection Timed Out, Why?

When i put the target IP as 127.0.1.1, the program is working fine, can catch blocked & open ports. But when i try to scan remotely, i get connection timed out! Can you tell me why? :( Here is my code - Look at between where i put astriks - at the bottom: #include<iostream>... (3 Replies)
Discussion started by: f.ben.isaac
3 Replies

7. Programming

Socket programming in C

Hi, I wanted to write a socket program in C, where I always want my socket connected to the server. i.e i shouldn't get disconnected once i get the response back from the server. I want to work in the connected mode, instead of disconnect and connect. Can somebody please kindly provide me a... (3 Replies)
Discussion started by: sudharma
3 Replies

8. UNIX for Advanced & Expert Users

socket programming

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

9. 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

10. Programming

socket programming

how to include socket.h in visual studio 2005.. (2 Replies)
Discussion started by: asd123
2 Replies
rpc_use_family_wk(3ncs) 												   rpc_use_family_wk(3ncs)

Name
       rpc_use_family_wk - create a socket with a well-known port for a remote procedure call (RPC) server (server only)

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

       void rpc_$use_family_wk(family, ifspec, sockaddr, slength, status)
       unsigned long family;
       rpc_$if_spec_t *ifspec;
       socket_$addr_t *sockaddr;
       unsigned long *slength;
       status_$t *status;

Arguments
       family	      The  address  family  of the socket to be created.  This value corresponds to the communications protocol used to access the
		      socket and determines how the sockaddr is expressed.  The value must be one of socket_$unspec or socket_$internet.

       ifspec	      The interface that will be registered by the server.  Typically, this parameter is the interface if_spec	generated  by  the
		      NIDL compiler from the interface definition; the well-known port is specified as an interface attribute.

       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 that uses the port specified through the if_spec parameter.  Use this routine to create a  socket  only  if  a
       server must listen on a particular well-known port.  Otherwise, use

       A  server  listens  on one socket per address family, regardless of how many interfaces that it exports.  Therefore, servers that use well-
       known ports should make this call once per supported address family.

Examples
       The following statement creates the well-known socket identified by for an array processor server:
       rpc_$use_family_wk (socket_$internet, &matrix$if_spec,
			      &sockaddr, &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_$bad_pkt	   The server or client has received an ill-formed packet.

       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.

Files
See Also
       intro(3ncs), rpc_use_family(3ncs)

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