と がObjectOutputStream
ありObjectInputStream
ます。それらを介してintとオブジェクトを送信しようとします。今、私は何とか送信してポイントまで読むことができましたが、なぜそこで止まるのかわかりません。
ポイントは次のとおりです。
読者:
while (true) {
start = in.readInt();
System.out.println("PART 1");
int temp1 = in.readInt();
int temp2 = in.readInt();
int temp3 = in.readInt();
System.out.println("PART12");
Chunk temp = new Chunk(temp1,temp2, temp3);
while (true) {
part12 に到達しない (最初の int を渡さない...)
ライター:
if (chunkList != null) {
for (Chunk c: chunkList) {
out.writeInt(-1);
out.writeInt(c.getLocation().getX());
out.writeInt(c.getLocation().getY());
out.writeInt(c.getLocation().getZ());
if (c.getTileList() != null) {
すべてを正常に渡します。
私は別のスレッドで 2ms ごとに out.flushing しています。
スレッド:
while (true)
{
while (c.sendPacket()) {
try
{
if (c.getOut() != null)
{
c.getOut().flush();
}
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
}
try
{
sleep(2L);
}
catch (InterruptedException interruptedexception) { }
}
}
3 ints の部分で読み取りが停止するのはなぜですか?