Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Java Socket and Wireshark Help
New Posts  All Forums:Forum Nav:

Java Socket and Wireshark Help - Page 3

post #21 of 25
I'm not sure what you're asking. Are you asking how to read the data you previously wrote?
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #22 of 25
Thread Starter 
I'm asking how to catch any responses from the server (any packets sent from the server as a response to what I sent) and output it in the console.


Right now, the program terminates right after the out.write data is sent by me and received by the server.
post #23 of 25
What does the code look like? You probably need a loop.
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #24 of 25
Thread Starter 
When I put this code in after write
Code:
in = new BufferedReader(new InputStreamReader(
                                        echoSocket.getInputStream()));
char[] buffer = new buffer[] { }

while(in.ready()) {
       in.read(buffer);
            switch(buffer[0]) {
            case 0x01:
                System.out.println(buffer[0] + " is 0x01");
            default:
                System.out.println("Unrecognized packet data: " + buffer[0]);
            }
   }
write stops working too.

I'm starting to build a protocol now.
Edited by Lyoko - 6/29/08 at 8:28am
post #25 of 25
Thread Starter 
bump!
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Java Socket and Wireshark Help