Advertisement

some basic socket questions

Started by February 26, 2017 06:34 AM
20 comments, last by Helo7777 7 years, 8 months ago
would this Server in python be compatible with an Android/Java client side, and am I correct in assuming that the raw data type that can send/receive (for an initial test) can include bitmap-bytearray streaming for images?

Yes, only raw bytes go over the network, and both sides speak the same TCP protocol.

what of this server code (in Java), why is it not listening or connecting to the client?

ServerSocket servsock = new ServerSocket(8000);
sock = new Socket(serverIP, 8080)

Different port numbers, probably?

Edit: Other options include firewalls in modems/routers and/orcomputer systems, as inbound connections are normally not wanted

I don't have experience doing this in android or Java but I'd cut your program back to sending simple text for testing sake rather than an image. As others have said there are many variables in networking that can make it difficult such as routers and firewalls that can prevent an otherwise working app from sending/receiving.

I did a quick google search and grabbed some links that may assist with simple text sending/receiving. http://www.oracle.com/technetwork/java/socket-140484.html and http://stackoverflow.com/questions/7384678/how-to-create-socket-connection-in-android

This topic is closed to new replies.

Advertisement