question « Socket « Java Network Q&A

Home
Java Network Q&A
1.API
2.bluetooth
3.Client
4.connection
5.Cookie
6.Development
7.Email
8.File
9.ftp
10.http
11.HttpClient
12.https
13.ip
14.Network
15.OS
16.RMI
17.Security
18.Server
19.Socket
20.tcp
21.UDP
22.url
Java Network Q&A » Socket » question 

1. Java socket question    stackoverflow.com

I'm trying to write a simple server-client program, but I have a problem: I can send data from client to server, but I can't send data from the server (I can't recive ...

2. Questions with java socket    stackoverflow.com

In java, I can write code like this:

 ServerSocket ss = new ServerSocket(1111);
 Socket s = ss.accept();
 // here s.getLocalPort() is 1111
 ss.close();
 // here this is ok even s is ...

3. Baby Question    coderanch.com

I'm working out of a tutorial book and trying to get my EchoServer program running. I've got my own domain that is hosted remotely by a commercial service. What do I need to do, besides just uploading the class file, to get my EchoServer loaded up and listening on its port (which in this case is 5555)? Right now EchoServer.class sits ...

4. Java/Http Question    coderanch.com

I'm opening a socket and sending web pages to a client. When I send the Html only, the tag is never expanded to display the GIF image. It seems that I need to send the Images as well as the Html. I've tried using the 'HTTP/1.1 206 Partial Content', in addition to sending both files concatenated as one big response. ...

5. Where do I need to go to ask this question?    coderanch.com

I am wanting to see if anyone here has designed a textField that will accept only integers in the format of an IP Address (including the separating dots) or one for binary data that includes spaces for separating the fields (i.e. 0000 0000 0000 0000). I have not yet started extending JTextFields in this way and am not sure who/where to ...

6. Damn newbie has a question.    coderanch.com

Ok. I have been attempting to teach myself java, I am half way through this book and my boss decided to give me an assignment. I just got done learning about arrays and have pretty much only written simple applications. I have No idea how to amek applets yet, and can only write simple programs consisting off enter data, do math ...

7. Beginner Question    coderanch.com

I am new to the this topic and was wondering how easy it is to take an existing program and intergrate it into an Intranet...or does the program have to be written specifically for that purpose? I just don't want to have to re-code a huge amount of changes. Not sure how this book might assist me in this goal. Thanks ...

8. Very Basic Question    coderanch.com

Server name is the actual "name" of a server. DNS (Domain Naming System) is a method of storing the IP addresses of a server and tieing it to that servers name. Example: On a local network using the basic TCPIP tools, you can "ping" a machine. Each machine on this network has an IP address with it. Say I have a ...

9. an echo question.    coderanch.com

10. Socket Questions    coderanch.com

I'm only a beginner so this advice might not be that good but if your talking about having the server program handle multiple clients then thats fairly easy. All you need to do is pass the socket that is returned using the accept method on the serversocket to, well, anything you like, an array of sockets or an object that accepts ...

11. Questions about some elementary concept    coderanch.com

Hi, as a tyro to networking I am investigating my own box and local network. Dr. den Haans introduction to DNS is comprehensive and inviting but theres still some issue I dont quite understand: 1. Equipped with a router, my room mate shares an adsl Internet connection with me. Our ISP is 1&1, Germany. When DHCP enabled, the connection was very ...

12. Socket question    coderanch.com

Hi all, I need to have a server that goes up and down at different times. Let's say, server is supposed to start listening to messages on its socket at time 10, then it supposed to go down at time 100, then it comes back up at time 300, .... What I am currently doing is that, I create a ServerSocket ...

13. Socket Create question    coderanch.com

14. Barry's question    coderanch.com

15. Question about Three Phase-Commit.    coderanch.com

16. Design question    coderanch.com

All, I was looking for some ideas on what seems to be a common application. I want to develop a simple java server application that simply listens for connections and when a client connects, the application will spawn a thread that manages the socket and processes the incoming data, etc. and then the thread will clean up the socket, etc and ...

17. Question about posting..... urgent....    coderanch.com

Hi, I have to make a make a connection to a URL and get the HTML data from that... i can do this using URL conection and now after this i have to post the data i.e in text box & other data to that URL as well.. Can anyone please tell me how can i do this.. can i post ...

18. Question about "socket"    coderanch.com

I wanna create a client-server application and need to transfer various kinds of information between C-S, these information includes identity validation , talking and some others : And my question is : Can i declare numbers of input streams and output streams in a single socket connection just like "new data input stream(socket.getinput stream() )"? If yes , How can i ...

19. Question about Java's Capabilty    coderanch.com

Java is agressively platform independent, so Sun won't have any Java APIs for managing Windows thingies. You can use JNI to call from Java to Java-aware C++ modules, so it would be possible to wrap all the Windows APIs you need in C++ programs and call those from a slick Java UI program. You'd probably ask yourself why you're not using ...

20. question about socket encoding problem    coderanch.com

21. A general question    coderanch.com

Hello all, I have developed a chat client and now I'd like to add file transfer capability to it. Here are some of the thoughts I've had with respect to I should go about implementing this. 1. Do I need additional sockets ONLY for the sake of transfering files?(i.e. reading/writing to an extra socket) 2. Do I need additional threads to ...

22. writeObject / readObject question    coderanch.com

Hi, I have a client/server application that I've implemented using JAVA sockets. I am getting a "class not found" exception from the server when it tries to readObject(). Here is my client set up: public class client { out.writeObject(new myClass()); // some methods and other stuff class myClass { // some methods and stuff } } And my server set up ...

23. Client/Server Socket Question    coderanch.com

Hey, I'm just learning about how to do socket networking in Java and I had a question. I wrote a program that contains a simple client/server application where the client and server can talk back and forth. I've tested it on my computer, but I was wondering how I actually have it run from my website. I want to have my ...

24. Socket Question    coderanch.com

Greetings I have a strange bug that is driving me crazy My application works fine in single user mode, however... In network mode, I'm using a multi-threaded socket server The client portion is a new thread spawned from the GUI, this client thread waits until an object is received from the GUI, wakes up, sends this serialized object to the server ...

25. SSLv3 generel Question    coderanch.com

26. getHostName question    coderanch.com

Hello, In my code I have like this. // Changed the IP to a.b.c.d InetAddress ad = InetAddress.getByName("a.b.c.d"); ip = ad.getHostAddress(); hn = ad.getHostName(); // ip shows a.b.c.d // hn also shows a.b.c.d instead of the actual host name. When I am trying to do the nslookup for this a.b.c.d, I can get the DNS entry and displays the host/canonical name ...

27. Silly question about a project    coderanch.com

28. Apache client/server question    coderanch.com

I have a simple Java client-server application that works like I want it to when I run it using localhost. This is probably a real beginner's question, but how I go about deploying the server side of the application to a web server running Apache? What directory does it go in? When using a localhost, I have to start the server ...

29. noob question: sun tutorial, can't get it to work    coderanch.com

Hi, I was working through the sun tutorial on sockets here, and I wasn't able to get it to work. They said that when I created the socket, I needed to use the fully qualified ip name of the computer I was trying to connect to. I tried my name, which is the name of the computer when I type "netstat", ...

31. Socket design question    coderanch.com

I have a socket connection that needs to do the following: 1. Send data to the socket and return that info to the caller. 2. Use a thread to listen for data all the time, and send that data to a parser. I can do one or the other fine, but when trying to do both of these things I run ...

32. socket question    coderanch.com

Ok I found this on the net import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.Socket; import javax.net.ssl.SSLSocketFactory; public class Test { public static final String TARGET_HTTPS_SERVER = "www.verisign.com"; public static final int TARGET_HTTPS_PORT = 443; public static void main(String[] args) throws Exception { Socket socket = SSLSocketFactory.getDefault(). createSocket(TARGET_HTTPS_SERVER, TARGET_HTTPS_PORT); try { Writer out = new OutputStreamWriter( socket.getOutputStream(), "ISO-8859-1"); out.write("GET ...

33. another multi theaded socket question..    coderanch.com

34. something i don't understand in my routing table (simple question)    coderanch.com

Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 10.0.0.221 10.0.0.201 3 10.0.0.0 255.255.255.0 10.0.0.201 10.0.0.201 3 10.0.0.201 255.255.255.255 127.0.0.1 127.0.0.1 3 10.255.255.255 255.255.255.255 10.0.0.201 10.0.0.201 3 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 224.0.0.0 240.0.0.0 10.0.0.201 10.0.0.201 3 255.255.255.255 255.255.255.255 10.0.0.201 10.0.0.201 1 Default Gateway: 10.0.0.221 well when i send a packet with let's say 10.0.0.32/24 it well go to the ...

35. simple socket question    coderanch.com

36. Socket Max Length Question    java-forums.org

I am transferring a file from my JApplet through a socket to my server. It seems that my server socket receiver only reads in at most 65700 bytes at a time. Anything larger than that breaks my program. 1) Can I enlarge the 65700 limit? 100000 would be great. 2) If I cannot enlarge it, how can I read the data ...

37. Question about socket.isConnected() function    forums.oracle.com

Hello Here's the situation. We want to make sure that the server that we connect to is ready to receive data. In conjunction with creating a new socket, we call the socket.isConnected() function. If the return value is false, we display an error to the user. As a test we entered an incorrect IP address for the server we needed to ...

38. Question about socket from new Java Programer    forums.oracle.com

39. Socket Question    forums.oracle.com

40. question about socket and information hiding    forums.oracle.com

Hi, I read the article Advanced Socket Programming ( http://java.sun.com/developer/technicalArticles/ALT/sockets/ ) there is something that I doesn't understand very well, this: " ......This breaks information hiding and force tight coupling. A solution to this problem would be to write an interface that extends the Serializable interface and then have the SerializedObject class in Code Sample 8 implement the new interface. Using ...

41. Few Questions about Socket Programming?    forums.oracle.com

I was working on a client and multiclient server application. I had several problems, but at first I just want to be sure about some stuff: after a client connects to a server, then will the connection be alive until the client uses socket.close() ? And how can I listen for the incoming strings in client in socket connection?

42. Why doesn't this work? Socket / Gzip Question    forums.oracle.com

You have more problems here than I can shake a stick at. YES, I know I can use the web/URL class for this but I need to do it via sockets for many reasons. I can't see any of them in your code. out.print("GET / HTTP/1.0\n"); out.print("Host: " + host + "\n"); out.print("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) ...

43. Socket Programming, Simple Question    forums.oracle.com

Hello I need to write a simple program, which capitalizes the words. There is a server program, and a client program. Client sends the word to server, and server capitilizes it and turns it back. Everything is normal till that point. However I need to implement both the server program and the client program within the same code. But when I ...

44. socket question    forums.oracle.com

Hi All, we have the following configuration: Pc1 send a message via socket to Pc2. Pc2 Reply some small amount of data to Pc1 we need to measure the time between send and receive on Pc1(each message include time stamp). when we send a 120kbyte message each second we get some stable time without any jitters. we also send 1kbyte (in ...

45. Simple Socket Question    forums.oracle.com

46. Socket.shutdownOutput() Question    forums.oracle.com

47. newbie question about sockets    forums.oracle.com

i have read the sun java tutorials about networking... i have a simple question about sockets..... in the client socket example, are things always as simple as writing and reading from the socket ???? in the serversocket example, i cant understand why after we create a ServerSocket, we create a Socket and attach it to the ServerSOcket ????? please help thanks ...

48. socket question    forums.oracle.com

49. question in using sockets in parsing XML!!!!(urgent plz help)    forums.oracle.com

i have a server/client program and the client has some XML files the server want to process and parse them using DOM. But i want to do this without having to transfer neither the whole file nor line-by-line of the file does anybody know how to do this??? how to connect the output stream of the socket of the client with ...

50. Interesting Question About Sockets IO    forums.oracle.com

Read the API: A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods. When the BufferedInputStream is created, an internal buffer array is created. As bytes from the stream are read or skipped, the internal buffer is refilled as necessary from the contained input stream, many bytes at a ...

51. Question about sockets    forums.oracle.com

Hi there! I'm kinda new to Java sockets and I'm trying to get a java socket to be able to send and receive data with a C# socket. The code works alright, but it seems to take it's own time to send data across the network. I am guessing that the data is getting buffered somewhere before it is sent. Anyone ...

52. question on socket programming    forums.oracle.com

Hi there, I have problem on socket programming. I have built simple chat program and it work very fine. Then I try to implement the file transfer upon them. The problem is the file transfer did not working. My chat program before this using DataInputStream/DataOutputStream and the chat is working fine. For the file transfer I'm using BufferedInputStream/BufferedOutputStream. The error that ...

53. Java Sockets Question    forums.oracle.com

Hi Guys, I've got a problem. I'm using raw socket connections for Web and other queries. I know I can use URLConnect and similar but they do not provide the flexiblity that I need so please do not suggest that I use those isntead. My problem is that I can set the read timeout (socket.setSoTimeout) and I can set the write ...

54. socket state question    forums.oracle.com

I've asked this before but I could not find any useful method in the Socket class which would provide this functionality. I store the sockets a server creates to communicate to its clients in an array so later on I can send messages to all of them simultaneously (by using iteration). Problem is the socket list does not update and the ...

55. socket state question    forums.oracle.com

And what do you think 'connected' means? Does it mean, 'at some point this socket was opened'? Or does it mean ' this socket will carry traffic to the server because the server is still up'? If the second then the ONLY way to do this is to send something to the server. That is how TCP works. If the first ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.