I'm using Titanium Alloy to build a mobile app, and need to access our IRC for one of the features. I've set up a socket using Ti.Network.Socket.createTCP(), which connects successfully, but after I send anything over the socket I get a 54 error:
The operation couldn’t be completed. Connection reset by peer.
I believe the problem here is that Titanium sockets do not support SSL connections, which our IRC requires.
I've been looking into socket SSL for Titanium quite a bit. The Appcelerator docs do not mention SSL/TLS at all, and all posts I've found related to these features missing seem to be from 2011, with no workarounds.
No luck on finding any modules that solve this either.
Is there a way to set up Titanium sockets to connect using SSL?
If not, is there a workaround/module that can allow me to do this?
You could use SocketIO (on the server side) and for the Titanium App for iOS & Android, you could use this module, which works well (from personal experience): https://github.com/omorandi/tiws
Related
i am using openfire xmpp server and asmack library to implement chat service , the biggest issue that i face is the reconnection problem to the xmpp server.
whenever a connection is made to the xmpp server there are lots of stanza is being exchanged possibly around 5 to 7 stanza in a desktop applicaiton or web application it seems ok , but for mobile application where 3G link is pretty weak , in that case it too good to exchange so much of stanza.
i have tested that when the wifi has a weak signal or 3g link is down , i am making a reconnecting to the server (in background process) but i mostly get a response time out error and taking too much time if the connection gets successful.
i have seen messenger like whatsapp in which they are making a reconnection pretty fast. i want to do something like that only.
i have read about the pre-http binding but its exist in ejabber but didnt find anything in openfire moreover htt-prebinding is for anonymous users and i am using registered users only.
so can anyone tell me how can i reconnect fast to the xmpp server.
while exploring i saw xmpp protocol XEP 0198 to resume the streaming session but it seems openfire doesnt support this so can anyone tell me what is the better and faster way to reconnect to the openfire server when network link goes down.Please help me.
Your openfire version is too old,the newer is supported for session resume,by the way asmack is deprecated you can switch it to smack.here is github address:
https://github.com/igniterealtime/Smack.git
I am working on an application that uses socket to transfer data from one device to other without the server interference and it is important that no one can get a copy of the data only the sender and the receiver. The server will be only for certificate authority and ip addresses collection and distribution. The main issue was opening a connection between to devices and it was solved by configuring the router to accept outside connection and port for warding and so on .. yet i am building the application for users that wont bother themselves to configure there owb routers .. I am asking for a solution to the problem or a better way to set the communication between the devices.
I search the internet for more details on the subject and i found other solution is to use P2P. There are few P2P platform like jxta or sip2peer. that can reach the client even if the client is behind a fire wall and this solve the problem. instead of using java for android or swift for ios, i will use xamarin (C#) to do that, since xamarin is native cross platform IDE .. thanks to every body in this greet community.
I'd like to play with the idea of creating a server program that communicates with an iPhone app over socket connections. I've found several guides within Apple's documentation for client side programming (with CFNetwork, NSStream, etc) but I don't know where to begin on programming the server application, or even what language to use, or for that matter, how to deploy and run a server application on my current web hosting package through Go Daddy. A simple instant messenger style application example should get me started, but any advice is appreciated.
if you want to create socket connection is better to use CFNetwork , it has more flexibility for you I already used NSURLConnection but CFNetwork has better performance. this is my steps and how I developed my app :
configuration of server
selection C++ for my server side (service)
start to develop a client-side app for iphone to connect to server using NS classes
but I had some problems in sending and receiving message to and form server . so I changed it to CF classes it works better and faster now.
The easiest way to handle server-to-device communications is to use APNS (Apple Push Notification Services).
Communication in the other direction (device-to-server) can be handled simply with NSUrlConnection.
If you want to write your own socket code for this, well - good luck with that.
Do you want your client application to be able to run on more than one OS? If so, you might want to stay clear of anything Apple specific. Although, if you strictly want to run on iOS, using MusiGenesis' suggestion could save you a ton of time.
I have found that Python and Perl are both pretty great for socket programming. I know that Python has several libraries built in for handling HTTP requests etc. If you want to run your server as a daemon, I found this code very helpful:
http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
Here is a general python sockets guide:
http://docs.python.org/howto/sockets.html
Good luck.
I've seen some apps that connect to routers via ssh.
Can anyone recommend any documentation on interacting with Cisco IOS configs and notifications? I'd love to write some custom in-house code!
Most of the configuring/querying can be done via SNMP, so you don't have to have a SSH client/command parser built in you application. What's supported depends on router/ios version. You can check here: SNMP OID Browser. SNMP can sometimes be overwhelming, but in time it can be of great use to you. My first suggestion is to find a SNMP browser (eg. from solarwinds) so you can inspect what info you can get from the router. Then you can use NET-SNMP library to do the actual querying/configuring of the router, or if you are willing to pay you can try IP*Works.
i read in some stackOverflow post that The host would need to have port 2195 open and support push notifications under apns.how do i make my server to support apns.
what does this line means in Push Notification guide
To establish a trusted provider identity, we should
present this certificate to APNs at connection time using peer-to-peer authentication.
do i need to make a connection to APns through my native app? someone please explain this
Pretty much any server that doesn't have restriction on what sockets you can open is ready to be an APNS provider. In your project code, you can just open a socket to Apple servers (or use a library).
My understanding that Google App Engine and basically any traditional shared web hosting block any port other than 80, so you cannot use them. However, you can look into Urban Airship that provides a RESTful API that basically use from any service. It might get pricy though.
In short you need to establish an SSL connection, and then send the payload in the pre-defined binary format.
alt text http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Art/aps_provider_binary.jpg
See this guide for more details.
I use appengine, so I solved this by renting a super cheap server in hetzner.de. It basically serves as proxy to my appengine app and uses this library: https://github.com/notnoop/java-apns
that library has a one line way to send the message, using the certificate.
Google just opened up the ability to do Socket stuff on AppEngine, so I created a sample project that you can use to send push notifications using GCM and APNS in python. Feel free to use any of it that you like.
I've also included a sample iOS project and Android project that hook up nicely with the app engine solution.
https://github.com/GarettRogers/appengine-apns-gcm
** Full Disclosure ** this is my project, and I'm in no way trying to promote it because it's mine... it's simply the only available project that solves your problem at the moment. If you find anything that does a better job, please leave a comment.
You may check out java-apns-gae.
It's an open-source Java APNS library that was specifically designed to work (and be used) on Google App Engine.
https://github.com/ZsoltSafrany/java-apns-gae