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 am looking to write a simple client/server utilizing TCP sockets. Any ideas how to do network programming in Go?
Go has fine support for networking.
For a server, the easiest thing to do is have your main() start a tcp accept loop and spawn a goroutine to handle each request.
The first go software I wrote was a memcached server. You may want to check out gomemcached for an idea of how to get started on servers.
Clients shouldn't be particularly harder. In many cases, it may make the most sense to have a shared client with goroutines for inbound communication much like I use in gomemcached for communicating with the actual storage layer.
Of course, this isn't the only way. Perhaps you'll find something better as you experiment.
Related
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 6 years ago.
Improve this question
I am searching about how many connections can manage a server, I don't have any idea how to filter in google about it, even it would be fantastic if I could simulate an amount of queries and check by my self how many connections are possible
Thanks
I believe there are 6 available "pipes" when requesting resources from a server; such as, six images come through at a time to help populate a web page. However network speed ultimately determines efficiency of this. There are ways to increase the resources pulled by utilizing services such as Content Delivery Networks (CDN) to serve up only the images for example or a particular sub-domain to serve up query calls.
While the above may be out this scope, I came across this answer regarding concurrent user connections to an Apache server and how to manage counts.
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 7 years ago.
Improve this question
Good day stackoverflow. Presently I have a java server program which communicates with the client application through sockets(using the java ServerSocket and Socket classes). But I intend to develop another client application with an interface for configuring the server application, for which I would like to use RMI(Remote Method Invocation).
The question now is: is it possible and safe to use RMI in a java server program in which ServerSockets and Sockets are also being used? I am familiar with sockets good enough but new to RMI. I have gone through RMI documentation and other sources but got no answers yet. Please I would be obliged if someone can help
Yes, no problem. Just make sure you are not using the same sockets.
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 need to have 3 major things from perl and don't know how to go about it.
Non Blocking websocket implementation like mojo.
The server needs to accept broadcast calls after it has started
The server needs to be able to access data that is on a different thread.
I have tried mojo but didn't find a way to control the port (I can live with that) and didn't figure out how to call events after the server has started. I wasn't able to test if it could handle events after the fact.
I have tried Net::WebSocket::Server but it is blocking. I am tempted to wrap my own code around it so that it can handle non blocking and shared data as it is by far the simplest implementation and easy to modify.
I have also tried pocket.io but it didn't have a very easy way to implement OO design and still remain thread safe. (Mostly because of the Plack framework).
Does anyone have a good example of how to do this with Mojolicious or pocket.io? If not I will just have to implement my own implementation.
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 know this as been asked but couldn't find an answer that I understand...
Some people told me about the main thing are sagas, but it doesn't look such a big advantage to make me spend my bucks on NServiceBus when I already have MSMQ....
That's a little bit like asking "why do I need ASP.NET MVC when I already have HTTP?"... a little tongue-in-cheek, but still with a lot of truth in it.
NServiceBus gives you message serialization, a sensible threading model, routing, and several ready-to-use messaging patterns out of the box.
MSMQ gives you... message queues! And a fairly complicated API with many low level options that give you no real pit of succes...
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 8 years ago.
Improve this question
At work, we are speaking about the interest to have 10 or 30 connections simultanly to a usenet provider.
Some guys said it change nothing because the 10 or 30 threads will take all the bandwidth available, so the download time will be the same.
Another guys said it change something because you can download more file at the same time.
Someone have a GOOD explanation to this problematic ? :)
Thanks ^^
The NNTP protocol has a lot of latency, so running multiple simultaneous connections can improve the speed of actions, particularly if there's a lot of back and forth with the server. (More recent versions of the protocol have support for streaming, but not many clients or servers know about this yet.) 10-30 sounds like overkill to me, though; usually you get the benefits of avoiding latency with 4-8 connections.
The best thing to do would be to test a variety of different numbers of connections for the exact thing you're trying to do and see which one is faster, though. It's going to depend on what types of actions you're taking.