Reputation: 543
Can we connect below URL as a socket ? http://203.xxx.xx.xxx:4xxx/Feeds/Connect?UserId=abcd&Password=zxcv&ServiceLevel=17&Group=*&protocol=TCP
According to my Manager, he says : "Connect to above URL as a socket from your Android device & you will start getting the Stream of Feeds."
But as per my R&D on Sockets, a socket connection just needs an IP & a port. i.e.
Socket socket = new Socket("IPADDRESS","PORT-Number") & socket connection does not need a URL.
Thus, colleagues please guide me that i am gng wrong somewhere or my the backend ppl have misguided my Manager !
Please suggest some working, final Tutorial for Socket connection (Which provide data as a Stream.)
I have checked many tutorials but they guide to setup our own Server. Please suggest some tutorial with Server implemented.
Upvotes: 0
Views: 183
Reputation: 93668
You don't connect t a URL like that via a socket. Well I guess you could, but it would be a lot of work. That URL is an http URL. You connect to it via the Http protocol. In Android, that's an HttpUrlConnection. But you would not use a tcp socket unless you want to implement all of HTTP.
Upvotes: 1