Introduction The Server The Client References
FILE TRANSFER THROUGH SOCKETS
Muhammad Adil Raja
Roaming Researchers, R .
November 26, 2015
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
OUTLINE
1 INTRODUCTION
2 THE SERVER
3 THE CLIENT
4 REFERENCES
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
OUTLINE
1 INTRODUCTION
2 THE SERVER
3 THE CLIENT
4 REFERENCES
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
OUTLINE
1 INTRODUCTION
2 THE SERVER
3 THE CLIENT
4 REFERENCES
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
OUTLINE
1 INTRODUCTION
2 THE SERVER
3 THE CLIENT
4 REFERENCES
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
INTRODUCTION
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE SERVER I
/∗
∗ Copyright ( c ) 2013, Oracle and / or i t s a f f i l i a t e s . A l l r i g h t s reserved .
∗
∗ R e d i s t r i b u t i o n and use in source and binary forms , with or without
∗ modification , are permitted provided that the f o l l o w i n g conditions
∗ are met :
∗
∗ − Redistributions of source code must r e t a i n the above copyright
∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer .
∗
∗ − Redistributions in binary form must reproduce the above copyright
∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer in the
∗ documentation and / or other materials provided with the d i s t r i b u t i o n .
∗
∗ − Neither the name of Oracle or the names of i t s
∗ c o n t r i b u t o r s may be used to endorse or promote products derived
∗ from t h i s software without s p e c i f i c p r i o r w r i t t e n permission .
∗
∗ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
∗ IS " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
∗ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
∗ PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR
∗ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT , INCIDENTAL , SPECIAL ,
∗ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE SERVER II
∗ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
∗ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
∗ LIABILITY , WHETHER IN CONTRACT, STRICT LIABILITY , OR TORT (INCLUDING
∗ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
∗ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
∗/
import java . net . ∗ ;
import java . io . ∗ ;
public class FileTransferServer {
public static void main ( String [ ] args ) throws IOException {
i f ( args . length != 1) {
System . err . p r i n t l n ( "Usage : java EchoServer <port number>" ) ;
System . e x i t ( 1 ) ;
}
int portNumber = Integer . parseInt ( args [ 0 ] ) ;
FileInputStream f i s ;
BufferedInputStream bis ;
try (
ServerSocket serverSocket =
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE SERVER III
new ServerSocket ( Integer . parseInt ( args [ 0 ] ) ) ;
Socket clientSocket = serverSocket . accept ( ) ;
P r i n t W r i t e r out =
new P r i n t W r i t e r ( clientSocket . getOutputStream ( ) , true ) ;
BufferedReader in = new BufferedReader (
new InputStreamReader ( clientSocket . getInputStream ( ) ) ) ;
) {
String inputLine ;
String n u l l S t r =null ;
while ( ( inputLine = in . readLine ( ) ) != null ) {
F i l e myFile = new F i l e ( inputLine ) ;
/ / OutputStream os = n u l l ;
byte [ ] mybytearray = new byte [ ( int ) myFile . length ( ) ] ;
f i s = new FileInputStream ( myFile ) ;
bis = new BufferedInputStream ( f i s ) ;
bis . read ( mybytearray ,0 , mybytearray . length ) ;
/ / os = clientSocket . getOutputStream ( ) ;
System . out . p r i n t l n ( " Sending " + inputLine + " ( " + mybytearray . length + " bytes
out . p r i n t l n (new String ( mybytearray ) ) ;
/ / out . p r i n t l n ( "  r  n " ) ;
/ / out . write ( mybytearray ,0 , mybytearray . length ) ;
/ / out . write ( "  r  n " . getBytes ( ) ) ;
out . flush ( ) ;
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE SERVER IV
System . out . p r i n t l n ( "Done . " ) ;
/ / out . p r i n t l n ( "  r  n " ) ;
/ / out . flush ( ) ;
System . out . p r i n t l n ( "Bye Input ! " ) ;
System . out . p r i n t l n ( "Bye Error ! " ) ;
f i s . close ( ) ;
bis . close ( ) ;
/ / os . close ( ) ;
out . p r i n t l n ( "Bye : " ) ;
}
} catch ( IOException e ) {
System . out . p r i n t l n ( " Exception caught when t r y i n g to l i s t e n on port "
+ portNumber + " or l i s t e n i n g f o r a connection " ) ;
System . out . p r i n t l n ( e . getMessage ( ) ) ;
}
}
}
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE CLIENT I
/∗
∗ Copyright ( c ) 1995, 2013, Oracle and / or i t s a f f i l i a t e s . A l l r i g h t s reserved .
∗
∗ R e d i s t r i b u t i o n and use in source and binary forms , with or without
∗ modification , are permitted provided that the f o l l o w i n g conditions
∗ are met :
∗
∗ − Redistributions of source code must r e t a i n the above copyright
∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer .
∗
∗ − Redistributions in binary form must reproduce the above copyright
∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer in the
∗ documentation and / or other materials provided with the d i s t r i b u t i o n .
∗
∗ − Neither the name of Oracle or the names of i t s
∗ c o n t r i b u t o r s may be used to endorse or promote products derived
∗ from t h i s software without s p e c i f i c p r i o r w r i t t e n permission .
∗
∗ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
∗ IS " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
∗ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
∗ PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR
∗ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT , INCIDENTAL , SPECIAL ,
∗ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE CLIENT II
∗ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
∗ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
∗ LIABILITY , WHETHER IN CONTRACT, STRICT LIABILITY , OR TORT (INCLUDING
∗ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
∗ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
∗/
import java . io . ∗ ;
import java . net . ∗ ;
public class F i l e T r a n s f e r C l i e n t {
public f i n a l static String FILE_TO_RECEIVED = " c : / temp / source−downloaded . pdf " ; / / you may
/ / d i f f e r e n t name because i don ’ t
/ / overwrite the one used by serve
public f i n a l static int FILE_SIZE = 6022386; / / f i l e size temporary hard coded
/ / should bigger than the f i l e to be downloaded
public static void main ( String [ ] args ) throws IOException {
i f ( args . length != 2) {
System . err . p r i n t l n (
"Usage : java TelnetClient <host name> <port number>" ) ;
System . e x i t ( 1 ) ;
}
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE CLIENT III
int bytesRead ;
int current = 0;
/ / FileOutputStream fos = n u l l ;
/ / BufferedOutputStream bos = n u l l ;
String hostName = args [ 0 ] ;
int portNumber = Integer . parseInt ( args [ 1 ] ) ;
byte [ ] mybytearray = new byte [ FILE_SIZE ] ;
/ / current = bytesRead ;
try (
Socket echoSocket = new Socket ( hostName , portNumber ) ;
P r i n t W r i t e r out =
new P r i n t W r i t e r ( echoSocket . getOutputStream ( ) , true ) ;
BufferedReader in =
new BufferedReader (
new InputStreamReader ( echoSocket . getInputStream ( ) ) ) ;
BufferedReader stdIn =
new BufferedReader (
new InputStreamReader ( System . in ) )
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE CLIENT IV
) {
String userInput , serverOutput ;
while ( ( userInput = stdIn . readLine ( ) ) != null ) {
out . p r i n t l n ( userInput ) ;
/ / fos = new FileOutputStream ( userInput +". t x t " ) ;
/ / bos = new BufferedOutputStream ( fos ) ;
P r i n t W r i t e r pw = new P r i n t W r i t e r (new BufferedWriter (new F i l e W r i t e r ( userInput+"
System . out . p r i n t l n ( " FileTransfer : " ) ;
current =0;
serverOutput=null ;
while ( ! ( serverOutput=in . readLine ( ) ) . equalsIgnoreCase ( "Bye : " ) ) {
/ / bos . write ( serverOutput . getBytes ( ) , 0 , serverOutput . getBytes ( ) . length
/ / current=current+serverOutput . getBytes ( ) . length ;
pw. p r i n t l n ( serverOutput ) ;
System . out . p r i n t l n ( serverOutput ) ;
}
System . out . p r i n t l n ( "Bye Client " ) ;
/ / fos . close ( ) ;
/ / bos . close ( ) ;
pw. close ( ) ;
}
} catch ( UnknownHostException e ) {
System . err . p r i n t l n ( "Don ’ t know about host " + hostName ) ;
System . e x i t ( 1 ) ;
} catch ( IOException e ) {
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
THE CLIENT V
System . err . p r i n t l n ( " Couldn ’ t get I /O f o r the connection to " +
hostName ) ;
System . e x i t ( 1 ) ;
}
}
}
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets
Introduction The Server The Client References
REFERENCES
The source code has been taken from
here.
This presentation has been produced with LATEX.
Berlin, spruce.
Muhammad Adil Raja Roaming Researchers, R .
File Transfer Through Sockets

File Transfer Through Sockets

  • 1.
    Introduction The ServerThe Client References FILE TRANSFER THROUGH SOCKETS Muhammad Adil Raja Roaming Researchers, R . November 26, 2015 Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 2.
    Introduction The ServerThe Client References OUTLINE 1 INTRODUCTION 2 THE SERVER 3 THE CLIENT 4 REFERENCES Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 3.
    Introduction The ServerThe Client References OUTLINE 1 INTRODUCTION 2 THE SERVER 3 THE CLIENT 4 REFERENCES Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 4.
    Introduction The ServerThe Client References OUTLINE 1 INTRODUCTION 2 THE SERVER 3 THE CLIENT 4 REFERENCES Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 5.
    Introduction The ServerThe Client References OUTLINE 1 INTRODUCTION 2 THE SERVER 3 THE CLIENT 4 REFERENCES Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 6.
    Introduction The ServerThe Client References INTRODUCTION Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 7.
    Introduction The ServerThe Client References THE SERVER I /∗ ∗ Copyright ( c ) 2013, Oracle and / or i t s a f f i l i a t e s . A l l r i g h t s reserved . ∗ ∗ R e d i s t r i b u t i o n and use in source and binary forms , with or without ∗ modification , are permitted provided that the f o l l o w i n g conditions ∗ are met : ∗ ∗ − Redistributions of source code must r e t a i n the above copyright ∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer . ∗ ∗ − Redistributions in binary form must reproduce the above copyright ∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer in the ∗ documentation and / or other materials provided with the d i s t r i b u t i o n . ∗ ∗ − Neither the name of Oracle or the names of i t s ∗ c o n t r i b u t o r s may be used to endorse or promote products derived ∗ from t h i s software without s p e c i f i c p r i o r w r i t t e n permission . ∗ ∗ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ∗ IS " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ∗ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ∗ PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ∗ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT , INCIDENTAL , SPECIAL , ∗ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 8.
    Introduction The ServerThe Client References THE SERVER II ∗ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ∗ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ∗ LIABILITY , WHETHER IN CONTRACT, STRICT LIABILITY , OR TORT (INCLUDING ∗ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ∗ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ∗/ import java . net . ∗ ; import java . io . ∗ ; public class FileTransferServer { public static void main ( String [ ] args ) throws IOException { i f ( args . length != 1) { System . err . p r i n t l n ( "Usage : java EchoServer <port number>" ) ; System . e x i t ( 1 ) ; } int portNumber = Integer . parseInt ( args [ 0 ] ) ; FileInputStream f i s ; BufferedInputStream bis ; try ( ServerSocket serverSocket = Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 9.
    Introduction The ServerThe Client References THE SERVER III new ServerSocket ( Integer . parseInt ( args [ 0 ] ) ) ; Socket clientSocket = serverSocket . accept ( ) ; P r i n t W r i t e r out = new P r i n t W r i t e r ( clientSocket . getOutputStream ( ) , true ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( clientSocket . getInputStream ( ) ) ) ; ) { String inputLine ; String n u l l S t r =null ; while ( ( inputLine = in . readLine ( ) ) != null ) { F i l e myFile = new F i l e ( inputLine ) ; / / OutputStream os = n u l l ; byte [ ] mybytearray = new byte [ ( int ) myFile . length ( ) ] ; f i s = new FileInputStream ( myFile ) ; bis = new BufferedInputStream ( f i s ) ; bis . read ( mybytearray ,0 , mybytearray . length ) ; / / os = clientSocket . getOutputStream ( ) ; System . out . p r i n t l n ( " Sending " + inputLine + " ( " + mybytearray . length + " bytes out . p r i n t l n (new String ( mybytearray ) ) ; / / out . p r i n t l n ( " r n " ) ; / / out . write ( mybytearray ,0 , mybytearray . length ) ; / / out . write ( " r n " . getBytes ( ) ) ; out . flush ( ) ; Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 10.
    Introduction The ServerThe Client References THE SERVER IV System . out . p r i n t l n ( "Done . " ) ; / / out . p r i n t l n ( " r n " ) ; / / out . flush ( ) ; System . out . p r i n t l n ( "Bye Input ! " ) ; System . out . p r i n t l n ( "Bye Error ! " ) ; f i s . close ( ) ; bis . close ( ) ; / / os . close ( ) ; out . p r i n t l n ( "Bye : " ) ; } } catch ( IOException e ) { System . out . p r i n t l n ( " Exception caught when t r y i n g to l i s t e n on port " + portNumber + " or l i s t e n i n g f o r a connection " ) ; System . out . p r i n t l n ( e . getMessage ( ) ) ; } } } Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 11.
    Introduction The ServerThe Client References THE CLIENT I /∗ ∗ Copyright ( c ) 1995, 2013, Oracle and / or i t s a f f i l i a t e s . A l l r i g h t s reserved . ∗ ∗ R e d i s t r i b u t i o n and use in source and binary forms , with or without ∗ modification , are permitted provided that the f o l l o w i n g conditions ∗ are met : ∗ ∗ − Redistributions of source code must r e t a i n the above copyright ∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer . ∗ ∗ − Redistributions in binary form must reproduce the above copyright ∗ notice , t h i s l i s t of conditions and the f o l l o w i n g disclaimer in the ∗ documentation and / or other materials provided with the d i s t r i b u t i o n . ∗ ∗ − Neither the name of Oracle or the names of i t s ∗ c o n t r i b u t o r s may be used to endorse or promote products derived ∗ from t h i s software without s p e c i f i c p r i o r w r i t t e n permission . ∗ ∗ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ∗ IS " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ∗ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ∗ PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ∗ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT , INCIDENTAL , SPECIAL , ∗ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 12.
    Introduction The ServerThe Client References THE CLIENT II ∗ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ∗ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ∗ LIABILITY , WHETHER IN CONTRACT, STRICT LIABILITY , OR TORT (INCLUDING ∗ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ∗ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ∗/ import java . io . ∗ ; import java . net . ∗ ; public class F i l e T r a n s f e r C l i e n t { public f i n a l static String FILE_TO_RECEIVED = " c : / temp / source−downloaded . pdf " ; / / you may / / d i f f e r e n t name because i don ’ t / / overwrite the one used by serve public f i n a l static int FILE_SIZE = 6022386; / / f i l e size temporary hard coded / / should bigger than the f i l e to be downloaded public static void main ( String [ ] args ) throws IOException { i f ( args . length != 2) { System . err . p r i n t l n ( "Usage : java TelnetClient <host name> <port number>" ) ; System . e x i t ( 1 ) ; } Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 13.
    Introduction The ServerThe Client References THE CLIENT III int bytesRead ; int current = 0; / / FileOutputStream fos = n u l l ; / / BufferedOutputStream bos = n u l l ; String hostName = args [ 0 ] ; int portNumber = Integer . parseInt ( args [ 1 ] ) ; byte [ ] mybytearray = new byte [ FILE_SIZE ] ; / / current = bytesRead ; try ( Socket echoSocket = new Socket ( hostName , portNumber ) ; P r i n t W r i t e r out = new P r i n t W r i t e r ( echoSocket . getOutputStream ( ) , true ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( echoSocket . getInputStream ( ) ) ) ; BufferedReader stdIn = new BufferedReader ( new InputStreamReader ( System . in ) ) Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 14.
    Introduction The ServerThe Client References THE CLIENT IV ) { String userInput , serverOutput ; while ( ( userInput = stdIn . readLine ( ) ) != null ) { out . p r i n t l n ( userInput ) ; / / fos = new FileOutputStream ( userInput +". t x t " ) ; / / bos = new BufferedOutputStream ( fos ) ; P r i n t W r i t e r pw = new P r i n t W r i t e r (new BufferedWriter (new F i l e W r i t e r ( userInput+" System . out . p r i n t l n ( " FileTransfer : " ) ; current =0; serverOutput=null ; while ( ! ( serverOutput=in . readLine ( ) ) . equalsIgnoreCase ( "Bye : " ) ) { / / bos . write ( serverOutput . getBytes ( ) , 0 , serverOutput . getBytes ( ) . length / / current=current+serverOutput . getBytes ( ) . length ; pw. p r i n t l n ( serverOutput ) ; System . out . p r i n t l n ( serverOutput ) ; } System . out . p r i n t l n ( "Bye Client " ) ; / / fos . close ( ) ; / / bos . close ( ) ; pw. close ( ) ; } } catch ( UnknownHostException e ) { System . err . p r i n t l n ( "Don ’ t know about host " + hostName ) ; System . e x i t ( 1 ) ; } catch ( IOException e ) { Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 15.
    Introduction The ServerThe Client References THE CLIENT V System . err . p r i n t l n ( " Couldn ’ t get I /O f o r the connection to " + hostName ) ; System . e x i t ( 1 ) ; } } } Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets
  • 16.
    Introduction The ServerThe Client References REFERENCES The source code has been taken from here. This presentation has been produced with LATEX. Berlin, spruce. Muhammad Adil Raja Roaming Researchers, R . File Transfer Through Sockets