C code along with server

This is a discussion on C code along with server within the Networking/Device Communication forums, part of the General Programming Boards category; hey community, i'd like to know if anyone could tip me in the right direction in solving my problem. i ...

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

    C code along with server

    hey community,

    i'd like to know if anyone could tip me in the right direction in solving my problem.

    i have a c program that runs fine in the command line.

    but i have to integrate my algorithm into a server in order for others to easily access it.

    i've tried several different approaches:
    -adapting fastCGI library into my code in order to link it to nginx and send requests to my code. unfortunately i did not succeed in implementing this approach, due the fact that most likely that library is outdated (1996) and patching it makes no sense to me.
    -also i've been playing around with socket programming and integrating them directly into my code. which kind of brought in more hassle instead of easing my task.

    what im asking here is if anyone knows a faster, slicker and perhaps more elegant solution to binding C code to a server without writing a dedicated server/client model (which would probably result in more bugs in code)

    thanks beforehand!

  2. #2
    Nor
    Nor is offline
    h ֆhr s Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    you can setup a very simple server, by having your program open a socket, and use input from the socket as if it was keyboard input. and flushing all your output to the socket. basicly making a telnet like shell.

    even easyer would be write a program which will spawn a application with redirected stdin stdout and stderr pipes, which you direct to the socket connection.
    but that requires knowing your operating system.
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with server code !!!
    By Gaurav Singh in forum Networking/Device Communication
    Replies: 5
    Last Post: 03-21-2011, 10:04 AM
  2. Server code Errors that I do not understand
    By cloudsword in forum C Programming
    Replies: 5
    Last Post: 12-04-2009, 10:45 AM
  3. Client/server shared code
    By C+/- in forum C++ Programming
    Replies: 1
    Last Post: 05-19-2007, 10:45 AM
  4. So this is the code for the client and server
    By Bharat_kumarr in forum C++ Programming
    Replies: 14
    Last Post: 09-09-2004, 11:42 AM
  5. Code for Client/Server Socket
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 01-15-2002, 09:30 AM

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