TCP client on android not connecting after kernel change -
i've been using test phone develop app requires phone being set client offload computation dedicated workstation. phone had been rooted once flashed kernel, no longer connects. tried switching unrooted phone, couldnt connect either same code.
i tried setting toy tcp client/server examples , neither of phones work client. both work servers.
i'd appreciate hints connectivity or references might help.
edit: used telnet terminal emulator on phone , connection established, must code after , kernel has less thought.
(first time poster if post lacks clarity, tell)
else if (motionevent.action_up == event.getaction()) { mngr.unregisterlistener(this); view.setbackgroundresource(mthumbids[(++imgcount)%4]); copyfiletointernal(filename); file file = new file("/data/data/"+cachedfileprovider.authority+"/cache/"+ filename); try { log.d("debug", "tcp client: connecting..."); client = new socket(); client.connect(new inetsocketaddress("192.168.0.6", 4447),5000); log.d("debug", "port connected"); byte[] mybytearray = new byte[(int) file.length()]; //create byte array file fileinputstream fileinputstream = new fileinputstream(file); bufferedinputstream bufferedinputstream = new bufferedinputstream(fileinputstream); bufferedinputstream.read(mybytearray, 0, mybytearray.length); //read file outputstream outputstream = client.getoutputstream(); outputstream.write(mybytearray, 0, mybytearray.length); //write file output stream byte byte outputstream.flush(); bufferedinputstream.close(); outputstream.close(); client.close(); }catch (sockettimeoutexception e) { log.d("debug", "could not listen on port"); system.exit(1); } catch (unknownhostexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); }
Comments
Post a Comment