Sponsored Content
Top Forums Programming socket problems with cc compile options??? Post 302188862 by googling2000 on Thursday 24th of April 2008 11:40:37 AM
Old 04-24-2008
I don't think the code is to blame here.
I'm wondering if there is some compiler option that I'm not setting properly.

Remember the client code works fine.
I can execute it manually from the command line.
I can stick it into a shell script and execute it fine from there too.
I can run it from a program and it works great.
I can run is a differnt user, no problem.

The server code works fine too.
No problems with 400K launches per month, for the last 10 years.
It has no problems launching other binaries or shell or perl scripts.

Is there some option that "helps" compile a socket program that must run withing a socket program?
Like maybe I need to include some libraries on the compile line or some flags telling it "remember you have to live with some other sockets here"
 

9 More Discussions You Might Find Interesting

1. IP Networking

socket options

Hello there The socket option IP_OPTIONS returns an integer value, supposed to be the contents of the IP header. Could you please help me out to interpret those values. ThankYou. (1 Reply)
Discussion started by: hufs375
1 Replies

2. Programming

Please help! accept function problems in Socket programming

Hi, I have a client-server socket program. It has been working fine for over a year, but recently it started to show strange behavior.:confused: After the server program runs for a while, it will show in the top command saying it is using lots of CPU, MEM. I assume it means the server code is... (1 Reply)
Discussion started by: natxie
1 Replies

3. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

4. Programming

socket function to read a webpage (socket.h)

Why does this socket function only read the first 1440 chars of the stream. Why not the whole stream ? I checked it with gdm and valgrind and everything seems correct... #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include... (3 Replies)
Discussion started by: cyler
3 Replies

5. Solaris

Socket options

Hi everyone, Question for gurus: Is there a way for us to determine the options used by a socket? I basically want to know if SO_KEEPALIVE is enabled on a socket to know if the tcp_keepalive_abort_interval parameter will be used by that connection. Was I clear enough? :confused: ... (0 Replies)
Discussion started by: plmachiavel
0 Replies

6. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

7. Shell Programming and Scripting

bash script to compile multiple .c files with some options

I'm trying to write a bash script and call it "compile" such that running it allows me to compile multiple files with the options "-help," "-backup," and "-clean". I've got the code for the options written, i just can't figure out how to read the input string and then translate that into option... (5 Replies)
Discussion started by: travis.batzer
5 Replies

8. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

9. Programming

Looping problems socket programming in C

Sorry if I posted 2 separate questions. I'm currently doing socket programming on my current task. As you can see below in the client side. I've tried to do a loop so I will be able to get prompt for input over and over again. This is the code. do{ printf("Please your name > ");... (10 Replies)
Discussion started by: aLHaNz
10 Replies
SOCKET_SET_BLOCK(3)							 1						       SOCKET_SET_BLOCK(3)

socket_set_block - Sets blocking mode on a socket resource

SYNOPSIS
bool socket_set_block (resource $socket) DESCRIPTION
The socket_set_block(3) function removes the O_NONBLOCK flag on the socket specified by the $socket parameter. When an operation (e.g. receive, send, connect, accept, ...) is performed on a blocking socket, the script will pause its execution until it receives a signal or it can perform the operation. PARAMETERS
o $socket - A valid socket resource created with socket_create(3) or socket_accept(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 socket_set_block(3) example <?php $socket = socket_create_listen(1223); socket_set_block($socket); socket_accept($socket); ?> This example creates a listening socket on all interfaces on port 1223 and sets the socket to O_BLOCK mode. socket_accept(3) will hang until there is a connection to accept. SEE ALSO
socket_set_nonblock(3), socket_set_option(3). PHP Documentation Group SOCKET_SET_BLOCK(3)
All times are GMT -4. The time now is 01:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy