Sunday Feb 05
Move
Display 0 | 5 | 10 | 15 Stories

Programming

Topics
Top Story

Code for Writing a xlsx file in java

Here is a small code to write xlsx file though java code.    You may need to include some of...

Code for Reading a xlsx file in java

Here is a small code to read xlsx file thoug java code.    You may need to include some of the...

How to read and write data from socket in java

   ServerSocket serverSocket=new ServerSocket(port);  // The below statement will wait for the...

Producer Consumer Problem in C using Semaphores and Shared Memory

  The classic bounded-buffer problem can be implemented using a variety of synchronization mechanisms....

Common Intermediate Language

Common Intermediate Language (formerly called Microsoft Intermediate Language or MSIL) is the lowest-level...

Common Type System in C#

Common Language Runtime

A Quick Introduction to C# Features

Code for updating database using hibernate framework in java

Conversion of int to byte and vice versa

Web Crawler in Python

Neural Network in Python

Programming

How to read and write data from socket in java

(0 votes, average: 0 out of 5)





 

 ServerSocket serverSocket=new ServerSocket(port);

 // The below statement will wait for the connection from the other machine at the given port and as soon as the connection is established a socket is allocated for the connection and 

public Socket NewSocket= serverSocket.accept();

 

//for reading the data from the socket 

BufferedInputStream bufferinput=new BufferedInputStream(NewSocket.getInputStream());

DataInputStream datainput=new DataInputStream(bufferinput);

byte[] handsize=new byte[32];

// The control will halt at the below statement till all the 32 bytes are not read from the socket.  

datainput.readFully(handsize); 

 

 // For writing the data on the socket

Socket socket=null;

socket=new Socket(HostName,port);

BufferedOutputStream Boutput=new BufferedOutputStream(socket.getOutputStream());

byte[] headermake=new byte[32]; 

Boutput.write(headermake);

Boutput.flush(); 



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Google! Live! Facebook! Slashdot! Technorati! StumbleUpon! Spurl! Furl! Yahoo! Squidoo! Ask! DZone! Free Joomla PHP extensions, software, information and tutorials.



Comments

avatar comprar emails
0
 
 
This sounds good and need to read more about it.
B
i
u
Quote
Code
List
List item
URL
Name *
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar caneta espiã
0
 
 
What a nice article, thank you.
http://www.espionagem.esp.br/caneta-espia
B
i
u
Quote
Code
List
List item
URL
Name *
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar caneta espiã
0
 
 
What a nice article, thank you.
http://www.espionagem.esp.br/caneta-espia
B
i
u
Quote
Code
List
List item
URL
Name *
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
B
i
u
Quote
Code
List
List item
URL
Name *
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment

Tag Cloud

Login Form