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:
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
web service client JAXWS by mavenGenerate web service client stub class by using the JAXWS maven plugin. "jaxws-maven-plugin" will generate the web service stub classes by using that we can implement client or test the web service. generated stub classes … 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
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
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