Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Socket data arrival event

807601Jun 29 2008 — edited Jul 1 2008
Socket event for data arrival. Instant message it received but after the last send, the socket will get more informations, but how to return back for data arrival event.
public static void main(String[] args) throws Exception{
	Socket sck=new Socket("222.222.222.3",7800);
	DataOutputStream dos=new DataOutputStream(sck.getOutputStream());
	DataInputStream dis=new DataInputStream(sck.getInputStream());
	byte st[]=new byte[256];   st[0]=1;   st[1]=0x35; 		
                // Send command
                dos.write(st);dos.flush();
                // Receive reply
	dis.read(st);
                // New function call 
        
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2008
Added on Jun 29 2008
8 comments
161 views