I am trying to establish socket connection between pc and android using only usb(without wifi).I run the command in pc:
adb forward tcp:5000 tcp:9000
I write client code on pc(bind a client socket to port 5000),and I write sever code on android(bind a ServerSocket object to port 9000 and wait for request).I wonder if there's a way to set pc as the server and android as client.I have noticed that adb will occupy port 5000 on pc, so I can't write server code to listen on port 5000.
Is there any way to establish such socket connection(pc as server,android as client) using only usb?(Is adb forward a good choice here ?)