c++ socket in linux

This is a discussion on c++ socket in linux within the C++ Programming forums, part of the General Programming Boards category; i have one problem in my mulitple client-server (c++) ,i have two server made for different purpose ,i want to ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    7

    Unhappy c++ socket in linux

    i have one problem in my mulitple client-server (c++) ,i have two server made for different purpose ,i want to start the two servers at same time with different port number through shell scipt how can i design my program? could give u suggestions plz .

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    2,266
    First of all, your thread title is very misleading.

    in any case, shell scripts are easy in linux. if you only want to start two copies of your process on separate ports, just make sure your program accepts a port number as a command line parameter, and then create a text file called "start-server.sh" and put the commands in it to start the server on the two ports. the first line of your shell script should be
    Code:
    #!/bin/sh
    then just set the file to be executable with chmod, and then you can just run it from the command line by typing ./start-server.sh

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux raw socket
    By odomae in forum Networking/Device Communication
    Replies: 3
    Last Post: 05-15-2011, 11:06 PM
  2. Socket Programming using C on linux
    By mgnidhi_3july in forum C Programming
    Replies: 2
    Last Post: 05-18-2010, 03:40 AM
  3. socket programming in c or c++ in linux...
    By pk20 in forum Linux Programming
    Replies: 5
    Last Post: 02-12-2009, 12:54 AM
  4. Linux Socket programming help
    By Keshi in forum C Programming
    Replies: 3
    Last Post: 03-15-2005, 02:58 PM
  5. Linux Socket Programming by Example
    By Munkey01 in forum Linux Programming
    Replies: 8
    Last Post: 04-26-2003, 10:58 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21