By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

sample server

P: n/a
Hello.

I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with examples
on how to implement it.

Thanks in advance,

Eugene.
Jul 22 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Eugene A wrote:
I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with examples
on how to implement it.


The answer to your request depends on what you mean by "server." The
C++ standard does not define the term. In order to get some ideas, try
googling for "BSD sockets."
Jul 22 '05 #2

P: n/a

"Jeff Schwab" <je******@comcast.net> wrote in message
news:8L********************@comcast.com...
Eugene A wrote:
I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with examples on how to implement it.


The answer to your request depends on what you mean by "server." The
C++ standard does not define the term. In order to get some ideas, try
googling for "BSD sockets."


Jeff,

I mean a program that is polling a port for messages and can produce a
response to that same port.

Thank you.
Jul 22 '05 #3

P: n/a
Eugene A wrote:
"Jeff Schwab" <je******@comcast.net> wrote in message
news:8L********************@comcast.com...
Eugene A wrote:

I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with
examples
on how to implement it.


The answer to your request depends on what you mean by "server." The
C++ standard does not define the term. In order to get some ideas, try
googling for "BSD sockets."

I mean a program that is polling a port for messages and can produce a
response to that same port.


The C++ language and standard libraries don't have any facilities for
working with "ports," nor do they define the concept of a port.
However, third-party libraries are available. The details depend on
your platform. Google for BSD Sockets.
Jul 22 '05 #4

P: n/a
Eugene A wrote:
"Jeff Schwab" <je******@comcast.net> wrote in message
news:8L********************@comcast.com...
Eugene A wrote:
I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with exampleson how to implement it.


The answer to your request depends on what you mean by "server." The
C++ standard does not define the term. In order to get some ideas, try
googling for "BSD sockets."


I mean a program that is polling a port for messages and can produce a
response to that same port.


C++ doesn't have "ports" either. Is this for some specific OS and
compiler? You might be able to find examples in that compiler's
documentation.

Jul 22 '05 #5

P: n/a
Eugene A wrote:
"Jeff Schwab" <je******@comcast.net> wrote in message
news:8L********************@comcast.com...
Eugene A wrote:

I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with
examples
on how to implement it.


The answer to your request depends on what you mean by "server." The
C++ standard does not define the term. In order to get some ideas, try
googling for "BSD sockets."

Jeff,

I mean a program that is polling a port for messages and can produce a
response to that same port.

Thank you.


Depends on how your platform defines "port". On the embedded system
that I am working on, we have 3 ports: 2 serial, one USB. We listen
to the ports and produce response messages back.

The code is written in C, but uses platform specific routines for
accessing the ports.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #6

P: n/a
"Eugene A" <lo*****@mailandnews.com> wrote in message news:<27******************************@news.terane ws.com>...
Hello.

I am looking for a source for a simple server that would just listen to
requests and produce responses to those requests. Prefarrably with examples
on how to implement it.

Thanks in advance,

Eugene.


Try http://www.alhem.net/Sockets/ - example 5 is a tcp/ip client/server thing.
Good luck.
Jul 22 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.