java - Xamarin Android Client in real device fail to connect with C++ socket server -
i have android client need communicate c++ socket server running on computer. have connected client the server using android emulator on computer. however, when try run app on real device, cannot connect. code on android client side is:
int32 port = 5037;//is port setting matters? ipaddress ipaddress = ipaddress.parse("128.101.251.176");//am setting ip address correct? ipendpoint ipe = new ipendpoint(ipaddress, port); socket sock = new socket(addressfamily.internetwork, sockettype.stream, protocoltype.tcp); sock.connect(ipe); //always stuck @ line my android device ipv4 address 128.101.252.96 , computer ipv4 address 128.101.251.176. means computer , android phone in same lan? how should setup ip address? , need make change on server side? thank you!
Comments
Post a Comment