Send and receive files from java socket programing
Sender :
1. Create a Scoket connection
ServerSocket servsock = new ServerSocket(13267);
2. Checks for the socket acceptence from socket client
Socket sock = servsock.accept();
3. Stream the file and output the stream
Receiver :
1. Create socket with sender ip address and port
Socket sock = new Socket("192.168.2.22",13267);
2. Get the stream from the socket .
InputStream is = sock.getInputStream();
Source Code
Send and Receive files from remote system
Related Posts:
WebServiceClient test codeFollowing is the sample test code to test the webservice import javax.xml.rpc.Call; import javax.xml.rpc.Service; import javax.xml.namespace.QName; public class TestClient { public static void main(String [] args) { … Read More
Coherenc samples and clustering with help of oracle coherence tutorialsAll below explanation and samples are done by reading the document provided by the oracle coherence. The simplest and most flexible way to create caches in Coherence is to use the cache configuration descriptor to define att… Read More
Generate Webservice proxy classes or client stub classes by MAVENAdd the following plugin and dependencies <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>axistools-maven-plugin</artifactId> … Read More
Universal sql file executorNeed to execute the sql files without client installation on the box download sqlsexecutor installer which will execute any sql file of database type Mysql,Oracle,Sybase and Mssql. download link https://sourceforge.net/pro… Read More
Send and Receive files from remote systemSend and receive files from java socket programing Sender : 1. Create a Scoket connection ServerSocket servsock = new ServerSocket(13267); 2. Checks for the socket acceptence from socket client Socket sock = servsock.acc… Read More
hey buddy great work.
ReplyDeletei can't reach your source code. i think it is deleted or something, can you please upload the source code.
thank you