How to use feeds in Java/Scala

Added by Henrik about 4 years ago

Not sure I understand what needs to be done to get the feeds running, login using REST is no problem but using TCP with RSS proves to be more problematic in Scala.

Below is a simple example using SSLSocket from Scala (however should be very similar to how Java looks since im using Java libs). When I run this code the while loop just runs forever, that is im getting no response from the server.

@ val requestData: String = s"""{"cmd":"login", "args":{ "session_key":"$sessionKey"}}${10.toChar}"""

var sslsocketfactory: SSLSocketFactory = SSLSocketFactory.getDefault().asInstanceOf[SSLSocketFactory]
var sslsocket: SSLSocket = sslsocketfactory.createSocket(host, port).asInstanceOf[SSLSocket]
sslsocket.setUseClientMode(true)
sslsocket.startHandshake()
var os = new PrintStream(new BufferedOutputStream(sslsocket.getOutputStream()))
var is = new BufferedInputStream(sslsocket.getInputStream())
os.println(requestData)
Thread.sleep(1000)
os.print(s"""{"cmd":"subscribe", "args":{"t":"price", "i":"1869", "m":30}}${10.toChar}""")
while(is.available()<1) {
log.info(sslsocket.isConnected.toString)
Thread.sleep(1000)
}
val buf = new Array[Byte](is.available)
is.read(buf)
val input = new String(buf)
log.info(input)
os.close()
is.close()
sslsocket.close()@

What I expect from this code is to get a Heatbeat message in input after 5 sec but nothing ever happens. What am I missing?


Replies (88)

hydrafacial machine - Added by website 25 days ago

hydrafacial machine may be a name given to hydradermabrasion – adermatological procedure. It involves a 3-step regimen that has cleansing, exfoliating, and infusing the skin with nourishing serums. This facial may be a one-size-fits-all approach and is suitable and safe for all skin types.

sbobet member - Added by website 25 days ago

Will apply for online football betting at SBOBET agents without having to spend a lot of money starting at the minimum of 100 baht, you can join us and have fun. The prize to win casino lottery tickets, if interested, add Line to talk with us first, as follows Line @ : SBO360 sbobet member

Streaming - Added by website 24 days ago

Video game live Streaming is an activity where people record themselves playing games to a live audience online

Real estate software - Added by website 24 days ago

Real Estate CRM and Real estate software by Remarso is an all in one real estate solution to manage your entire business The only Customer Relationship Management platform you need

RE: How to use feeds in Java/Scala - Added by website 23 days ago

Matchfinder is an Indian Matrimony website offering free paid memberships to marriage seekers We are a premier online matrimonial site for brides and grooms Call now 09394950001! or visit our website.

RE: How to use feeds in Java/Scala - Added by website 23 days ago

YSR Jala Kala Scheme, AP Govt dug up free of cost borewells for farmers of state ysrjalakala ap gov in ysr jalakala scheme

RE: How to use feeds in Java/Scala - Added by website 22 days ago

Eve’s Luxury is a Platform to make the availability of makeup and cosmetics products. We offer top-quality makeup products and beauty cosmetics.Best Bronzer for Girls

RE: How to use feeds in Java/Scala - Added by website 22 days ago

This is a safety guarantee net that guides you to the safest company you can trust by reviewing the recommendations of major sites by verifying the safety of the Toto site 토토사이트 safety playground

NYC Glass Mirrors - Added by website 20 days ago

NYC Glass Mirrors Company manufactures a wide range of luxury glass walls partition systems

Youtube Techno - Added by website 20 days ago

Subscribe to this channel to become a supporting fan of DJ BYZANTINE and get access to exclusive rewards. Youtube Techno

los angeles homes for sale - Added by website 20 days ago

los angeles homes for sale Compare kitchens and find modern homes. Use our smart app to find a home in Los angeles & California matched to your style and life.

RE: How to use feeds in Java/Scala - Added by website 19 days ago

Download free icons sets for web, mobile, and graphic design projects.

RE: How to use feeds in Java/Scala - Added by website 18 days ago

Click the anchor text to get know that How to do Alexa Pairing to WiFi Without App Easily.

RE: How to use feeds in Java/Scala - Added by website 18 days ago

Play Baccarat Online and Online Slots The best quality in Thailand with "SLOTBAR888" Auto deposit-withdrawal in just 30 seconds, play a variety of games in one place. Both online baccarat Online casino, online slots, fish shooting games that will keep you entertained 24 hours a day.บาคาร่าสูตร

RE: How to use feeds in Java/Scala - Added by website 17 days ago

Oahu is the harmless manner of gaining mixed up in web based modern casino period. It's not essential to result in a modern casino, do not need overcome tremendous settlements it's not necessary to possibly even demand to accommodate people in the slightest degree.먹튀검증사이트

RE: How to use feeds in Java/Scala - Added by website 17 days ago

Out of Lagos, the chagoury Group's operations include hospitality, construction, IT services, telecom international financing and more.

homework market - Added by website 15 days ago

"homework market:https://myhomeworkmarket.com/" offers reliable homework help to college and university students in United States of America, Canada, Australia ,Dubai and UK Order for homework help now

car for sale - Added by website 14 days ago

car for sale in Pakistan, Cars price in Pakistan - DealMarkaz.pk

shapeit gym & street wear - Added by website 14 days ago

Shop high quality shapeit gym & street wear, for men women, or choose online coaching with La Réunion based renowned fitness expert Ingrid Dijoux Only with shapeitservices com

Matchfinder - Added by website 14 days ago

Matchfinder is an Indian Matrimony website offering free paid memberships to marriage seekers We are a premier online matrimonial site for brides and grooms Call now 09394950001! or visit our website.

שרת וירטואלי - Added by website 13 days ago

When a blind man bears the standard pity those who follow…. Where ignorance is bliss ‘tis folly to be wise…. שרת וירטואלי

Filipino Kitchen - Added by website 13 days ago

Buffalo wings or more famously called as Chicken wings are fried chicken wings coated with sauce. Filipino Kitchen

รับทำ seo - Added by website 13 days ago

Hey If you are looking for best รับทำ seo then please click the anchor text to explore it.

piercing in interlaken - Added by website 10 days ago

WE ARE A TATTOO STUDIO LOCATED IN THE HEART OF INTERLAKEN SWITZERLAND PROMOTING GOOD QUALITY TATTOOS WITH CUSTOM ART, HIGH STANDARDS AND HIGH QUALITY MATERIALS . piercing in interlaken

1 2 3 4 (51-75/88)