Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've done a fair amount of coding in C++, and I'm looking into sockets. Can I listen to a socket on another computer on my network if there's no client program running on it? I would use this to listen to the HTTP port.
No, the program that listens on the socket must be running on the computer where you want to listen on. You could use a tool like ssh to log in to the other computer and launch your program there - but your program would have to be copied to the other computer first.
Well, you can kind of fake it with firewall rules to redirect traffic to your machine and back again, but the real socket is always on the computer that is running the program.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to host a cpp service as a executable file and able to track the log, handle the exception and able to handle high load.
You can try c-sevice-interface https://github.com/Taymindis/c-service-interface
This is a small bridge engine which can handle high load of request, any segfault will not break the engine, it will catch and free the thread, it is built on top NGINX, FCGI. You can setup the proxy, load balance, authentication via NGINX before reach to your interface.
The link shown as below is a wiki to Guide you how to startup from scratch.
https://github.com/Taymindis/fcgi-function/wiki/How-to-build-a-cpp-service-on-c-service-interface
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've written a simple TCP socket server in c++ that uses sys/socket and OpenSSL..
I wish to use this server in production and I haven't been able to find clear methods for testing a socket server at scale.
What are the best methods and/or tool for testing sockets?
Unless you want to write a custom test client, which obviously doesn't have to be in C++, there are some common tools that can be used to connect to your server. For example, you can use curl and telnet. Google for these tools and how to use them if you are not already familiar with them. The following answers might be helpful:
https connection using CURL from command line
https://superuser.com/questions/346958/can-the-telnet-or-netcat-clients-communicate-over-ssl
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to develop a server for an application of mine in C++. I'm not really familiar with networking concepts. This server is going be a simple one and I'll use one of the networking libraries out there. I just couldn't figure out the necessary keywords to research the following issue:
Let's say that there are 100 users on 100 different computers, all sharing the same internet connection, behind the same router. They all decide to open my client to connect to my server. How do you deal with this issue if you want to keep the connections open and on the same port.
For the purposes of your server, it doesn't make any difference whether those 100 connections are all coming from the same computer, from the same router, or from totally separate networks.
While the server side of the connection will use the same port for all of these, each connection will have a different combination of client side IP address and port. In the case you describe, where all 100 are behind the same router using the same IP address, the router will take care of making sure they all have different client side port numbers. You can read about network address translation (NAT) if you want to learn the details about one common way that is done.
This kind of server programming is not easy and requires network skills. You can have a look at this tutorial. It's C and unix, but it shows the function you'll need to use:
socket interface for network access
listening/accepting new connextion
forking new processes to handle the different clients (although in C++ you'd probebly look for multithreading which is more efficient for this kind of task).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Client server application on c++.
If client close programm , socket cloded but, if internet on client side was disconnected, socket doesn`t close.
You have no choice: you have to wait for the TCP timeout. When the timeout happens, your server socket will get closed as if the client had properly closed the connection (give or take the status/error code).
Depending on the settings of your server's TCP stack, it can take quite a while (I have seen systems where it took 30 minutes...). Just be patient.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How does it work? (Explain it in terms of server, writes, GETs, values, whatever).
DOes it work with Win32 apps?
I'll try to explain:
There is an application, with thrift
class/interface. When event that you
want to log occures, you send
message to the
Server, which collect logs from many
sources (application, server logs,
etc)
And then server decides what do
do with it: generate visualization,
send over tcp/ip, store in a file,
nfs, hdfs, you decide.
Server and client can be the same
app or machine, or this log data can
be sent from client over internet.
Definitely works with win32 apps.
It Works Great.
We're using Scribe to test some message processing.
We're sending Apache logs with Scribe. (Under Ubuntu)