Hello,
I'm using VxWorks Workbench and running on a VxWorks simulator vxsim.

Here is my code:

Code:
#include <stdio.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include "vxWorks.h" 
#include "sockLib.h" 
#include "inetLib.h" 
#include "hostLib.h" 
#include "ioLib.h" 
#include "msgQLib.h"
#include "errno.h"


#define NUM_SOCK 100

void main()
{
    int i;
    int sock[NUM_SOCK];
	
	
    for (i=0; i<NUM_SOCK; i++)
    {
        printf("%d\n", i);
        if ((sock[i] = socket(AF_INET, SOCK_STREAM, 0)) == -1)
        {
            perror("socket");
            printf("%d: errno = %d\n", i, errno);
        }
    }
}

Here is the out out that I get:

Code:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
socket: too many open files
17: errno = 24

How can I get around the open socket limitation?

- Ankur