The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed h and g options sivasenthil_k Shell Programming and Scripting 9 01-04-2006 05:21 AM
Socket Programming socket soshell High Level Programming 2 06-29-2004 04:49 AM
cat and wc options Laura01 Shell Programming and Scripting 1 09-08-2002 08:21 PM
socket options hufs375 IP Networking 1 05-09-2002 10:02 AM
cp options milage UNIX for Dummies Questions & Answers 3 07-12-2001 09:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
socket problems with cc compile options???

Hi there, a newbie as far as compiling c.
I have a problem, I've ported a fairly simple perl socket program over to c.

I compiled it as follows

cc simplesocket.c -lsocket -lnsl

compiles great, no errors.

When I launch it from the command line, it works great!!!!

However, if I launch this program from within another socket program
( a perl socket server (listener) program, basically doing an exec of this compiled program ).
The server program has no problems launching any other kinds of socket apps.

Is there some option I need to tell the compiler that will tell the program it will be running beneath another socket program????

Once again a newbie, any help appreciated.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-23-2008
Registered User
 

Join Date: Feb 2008
Posts: 18
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
how you are doing exec(). Could post the exec code.
Reply With Quote
  #3 (permalink)  
Old 04-24-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
socket problems with cc compile options???

There's really not much to the exec. ( actually it's backtick )


It's perl, so it looks like this, ( not that it looks much different )


$rc = `$path/simplesocket.bin >>/tmp/logging.txt 2>&1`;

Note, the launching program does not core or abend, it's just the socket program itself.
Reply With Quote
  #4 (permalink)  
Old 04-24-2008
Registered User
 

Join Date: Feb 2008
Posts: 18
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Could you post both sokcet program code and perl code. So that we can have look at that. By the information till now, no guesses about the problem.
Reply With Quote
  #5 (permalink)  
Old 04-24-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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"
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 07:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102