How to bind sockets in Solaris (correction) 
Author Message
 How to bind sockets in Solaris (correction)

Hi there

Sorry I posted the earlier msg accidentally.
I'm trying to compile a C program written for Aix in my Solaris 2.4
environment.But it seems that the bind in Solaris does not recognise the
socket address structures as defined in AIX .

The socketaddr structure in AIX looks like this :

      struct sockaddr {
            u_char   sa_len;   /*total length */
            u_char   sa_family;   /*address family */
           char  sa_data[14];    /* actually longer,address value */

In the program for AIX , the following decalaration is made :

int ls_socket ;                 /* FD for listening socket */
struct sockaddr_in ls_addr /*Name for listening socket */
int cl_socket;                     /*FD for client (call) socket */
struct sockaddr_in cl_addr;  /* Address for client socket */

The bind statement used in the AIX is

bind (ls_socket, &ls_addr , mynamelen)

So can anyone who's familiar with sockets in Solaris pls help . I'm really in
a fix since the program is written by someone who's no longer with my company.

What I need to know is how to define the socket address structures in Solaris
so that it will be recognised by its BIND command .
I did a grep in my system for sockaddr and it is found in the resolv.h and the
in.h file,but even with these 2 files included in the program there are still
errors in the compile. The error that I get in the compile looks like this :

warning : argument #2 is incompatible with prototype:
  prototype : pointer to struct sockaddr {ushort sa_family,arrar[14] of char
sa_data} : "/usr/include/sys/socket.h" , line 295

Please reply via email to me as I do not log into the News often,thanks.


Thu, 23 Apr 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. How to bind sockets address in Solaris?

2. NOTE :Correction Reg: Problems with linker ld on solaris

3. Dead sockets in Solaris?

4. Socket program using gcc on SUN Solaris 2.5.1


6. sockets and ports -- bind()

7. Socket binding on 2 IP address

8. TCP/IP sockets: runtime bind() error: invalid argument

9. Sockets Programming in C, a problem with bind

10. binding raw sockets?

11. Binding server socket !!!

12. socket binding


Powered by phpBB® Forum Software