![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parameters | jaay | Shell Programming and Scripting | 4 | 04-14-2008 05:10 AM |
| sed and parameters | scotty_123 | Shell Programming and Scripting | 7 | 03-26-2007 05:22 AM |
| Max NO of parameters | Shivdatta | Shell Programming and Scripting | 1 | 07-24-2006 09:11 AM |
| Need Parameters Help. | james2006 | Shell Programming and Scripting | 3 | 06-08-2006 11:46 AM |
| tar parameters | kmar | UNIX for Advanced & Expert Users | 4 | 10-23-2001 04:03 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I'm having trouble when running a program that uses the connect(). I keep receiving errno: 22. Below is the code that I am using.
Do I have the variables set up correctly? Am I passing the correct parameters? I have been searching for source code on the connect function but haven't found any. IF you know of some posted on the net I would really appreciate it. ------------------------------------------------------------------------- int read_sold(char rxfile[], char message[]) { int i, rc, s; char hostname[64]; char readbuff[MAXREAD]; struct sockaddr_in sin; struct sockaddr const fin; memset(readbuff, 0, MAXREAD); /* *** Get TCP address and socket */ for (i = 0; i < 3; i++){ if (tcpaddress(&s, POSTORXPORT, &sin, (sizeof(sin)), message) == 0) break; if (i == 2) return -1; } /* *** Try to connect to the address */ for (i = 0; i < 3; i++) { if (connect(s, &fin, sizeof(fin)) < 0) { if (i == 2) { sprintf(message, "Client CONNECT failed: errno = %d", errno); ------------------------------------------------------------------------- |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|