473,421 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

java socket programming

i am having a file containg data for students name and their marks. i am sending this file from client to server using
Expand|Select|Wrap|Line Numbers
  1. Socket clientSocket = new Socket("127.0.0.1", portNo);
  2. OutputStream os = clientSocket.getOutputStream();           
  3. os.write(clientWriteArr,0,clientWriteArr.length);
  4.  
and on server side reading the file contents using
Expand|Select|Wrap|Line Numbers
  1. ServerSocket sock = new ServerSocket(5432);
  2. Socket serverSocket = sock.accept();
  3. InputStream is = serverSocket.getInputStream();
  4.  
i am modifyidng the file contents on server side
all the above thing are working fine.
now i want to send this file back to client using the same socket connection. but this thing is not working and i am not getting any exception.
Oct 14 '10 #1
1 2817
JavierL
17
You need to open another connection, because you are sending in one way, one socket is waiting for input (and receiving), the other is sending.
Oct 15 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jean-Philippe Guyon | last post by:
Hello, I am trying to compile a class that uses socket using the Visual C++ ..NET compiler. I get the following error: ------ Build started: Project: infCommon, Configuration: Release Win32...
5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
1
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows...
4
by: jediknight | last post by:
Hi, I am trying to establish whether I can have a C# socket server and Java socket clients. From all the examples I have seen on the web refer to Java Servers and C# clients. Can anyone point...
2
by: Sandy | last post by:
Hi All, I'm a newbe to socket programming, I need to work on a project that has to be developed in C++ or Visual C++ ( I have 8.0 version) console application. which will be execute from a Java...
8
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In...
2
by: jlparise | last post by:
Hey everyone, I am really rusty on my Java socket programming and am having some confusing problems. I don't need the code debugged(even though it doesn't work). I'm not going to make you dig...
5
by: ranajui | last post by:
design a protocol where the communication between a client and a server is established by means of socket connection in java.
2
by: rayoflight | last post by:
This is how my test program works. Server will encrypt some text and sends it over to the client. The client will then decrypts it. However I have some problem decrypting it. When I play...
1
by: phpuser123 | last post by:
I just started socket programming in java.I read a few tutorial and came up with the following script import java.net.*; public class socket { /** * @param args */ public static...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.