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.
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 2 months ago.
Improve this question
I am working on a MacOS cocoa application using swift from which i have to send information using an object to another application on different machine which then use the information in it's code.
I am new to swift and sorry for my english if you don't to get it.
I have no idea how to do this. Please help me with this if anyone knows.
Well just so you know network communication can be pretty hard. I believe the easiest way is to use WebSocket, which establish a pipe of communication between two devices. You can then send any data you want over this socket.
One difficulty is for the devices to find one another : do they know each other's IP address ? Are they on the same local network ?
The second step is to decide what data you want to send. The simplest is to send JSON content which can be serialized / deserialized on each end easily.
Checkout :
tutorial for websocket
JSON Serialization
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
I'd like to get the data of a website. I'd like to display the table in an app. Do you have an idea how I could do it? Thanks for your answers!
Usually, you'd want the maintainer of the data you need to supply some API for machine-to-machine communication (a REST JSON web service, for example).
Since you are asking how to display the table in an app:
the easiest way would be to just point an UIWebView that way and go from there.
a more native look might be acomplished by parsing the data. As you included several 'parsing' tags, I guess this is what you'd prefer.
The problem with HTML scraping web pages (what you probably hope to do) is that the data you are looking for and foremost it's structure is prune to changes. If some unexpected changes can easily break your parser.
Thus, if you go for doing that (which might be prohibited by your school or other publisher, especially in germany), try to parse the data on your server and offer an web service for your app yourself. This way, you can react to changes of the structure faster and do not break the app for your users.
Seriously consider asking the school for an API.
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
Is there a way or a model by which I could create a "Choose your own adventure" type app using UIAlertViews?
While this is not a direct answer to the question, what you're going for here is going to provide a less than ideal user experience. Alerts are jarring and not really meant to be a constant UI element but more of an occasional interruption.
That said, if you do want to do something like this, using a block handler pattern rather than a delegate pattern will make the logic of your app much simpler and easier to follow.
For Xcode5/iOS7, I would recommend taking a look at BlocksKit which includes a category on UIAlertView to use completion blocks instead of a delegate.
New in iOS8 is the UIAlertController class which handles this very similarly without a need for an external component. It does require iOS 8 to use though.
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 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.