开发者

Problems transfering data between an application and a server using TCP sockets [Android]

开发者 https://www.devze.com 2023-02-12 05:01 出处:网络
My development team and I, are working on an application that uses a sql database, we try 开发者_StackOverflowto transfer a database from our application to a server using tcp sockets, we made some re

My development team and I, are working on an application that uses a sql database, we try 开发者_StackOverflowto transfer a database from our application to a server using tcp sockets, we made some research about sockets, the server program is written on java language using netbeans, and the application is written on eclipse.

We made several conectivity tests between the application and server programs, using the android emulator, we tried to made it local (running both programs on the same computer) and the server conects with the application, but it doesn´t receive all packages, it receives aproximately 2Kb (we want to transfer a 25Kb file), the same happens when we run the server on other computer in the same network, we made some tests using wireshark to capture all the packagesincoming from the application to the server and viceversa, we´ve noticed that the server receives all the data, but first it receives a 2Kb packet, after that server application receives an end ack, and then, the application receives the missing packages, and then discards them.

We also made some conectivity tests using a coby kyros tablet instead of the emulator, and we have no problem, the application running on the tablet, sends all the data, and the server receives it.

We want know if there are an error on the emulator, and how to solve it.

Please help us or send us yout feedback


This sounds like you are running into a configuration problem with your emulator environment. Take a look at the network configuration info for the emulator.

The fact that its working fine from the actual device suggests to me you have an emulator network configuration issue. There could be a number of issues. I imagine that wireshark can show the packets reaching the machine the emulator is on, but that doesn't mean they are making it into the virtual network the emulator is in.

To verify you'll probably need to use something like

telnet localhost <emulator port>
network capture start 
... run test ...
network capture stop

and then look at the capture file. That seems like it should capture your traffic inside the emulator environment to give you an idea of whats happening.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号