Hi
I just solve the problem , thanks Pete,
I found that in the output stream, I have to include the Out.write() statement in the same try () catch () with the construction of the outputstream , i.e.
OutputStream Out = TCPClient.getinputstream();
This is quite strange to me and make me...
Thanks for the advice,
For the listen() method, I have checked with the text book and other sample codes, and found that the listen method is not implemented as well, it is explained that the bind() and listen() are being done during the construction of a ServerSocket, i.e. at the line ...
Thanks Pete,
I have try to debug the code and find that the NullPointerException is most likely incurred by the InputStream and OutputStream, Since I found that when I try to close them , the same error appears, It seems that I have something wrong with the declaration of the In (inputStream)...
Thanks Pete,
I have try to debug the code and find that the NullPointerException is most likely incurred by the InputStream and OutputStream, Since I found that when I try to close them , the same error appears, It seems that I have something wrong with the declaration of the In (inputStream)...
Oh thanks for your notice,pete, perhaps I 'll summarize my problem in this manner!
When I run my program under these conditions:
try{
addr = InetAddress.getByName(peer_addr);
TCPclient = new Socket(addr, port);
OutputStream Out = TCPclient.getOutputStream();
Out.write(mBuffer...
Hi, I am new to JAVA and this time I am going to develop an application that employ the java stream socket, My problem is that I can successfully create a server socket, create a socket and connect to them together. but for the inputstream and outputstream, I don't know if it has problem with my...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.