Server 2 « 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 » Server 2 

1. design & generics for socket server    java-forums.org

Hi. I'm dealing a small program that has a SocketServer. I have a specific simple protocol that I'm implementing by myself. For the server I'm openeing a thread for every new session = socket (for a user connecting to the server). The problem is with the protocol design: I want to have an abstract class for "Message" - a protocol message ...

3. Server socket deployment    forums.oracle.com

My question is, What do i need to do in order to make the server accessible from any computer with an internet connection? :O w00t? How about running the server on a computer with internet access? **Note** Not having it behind an router might ease things up as well. Also, am I missing something really obvious, or are you implying that ...

4. sockets and oblect passing between servers    forums.oracle.com

There are a number of mistakes in your above code. 1) Your server will only ever handle one client and then quit. The socket returned from ServerSocket.accept should be spun off into a new thread. 2) Your current problem is that you are not flushing your stream on the server side with your initial object. Your client is waiting to read ...

5. Socket Server    forums.oracle.com

I have been studying java for a couple months now and have been working on programming a socket server for my java web chat program. My question is, how do I deploy the socket server code? I have just started learning about Tomcat but I have not yet figured out how I would go about deploying the socket server code on ...

6. Got IO Exception when creating 2000 server sockets    forums.oracle.com

Are you sure you really need 2000 server sockets? If you want to host 2000 connections to remote clients, you should only need 1 server socket to host them all. But that usually means 1 thread to process data on each client connection, and 2000 threads aren't going to perform very well. For this number of connections, you might want to ...

7. New to sockets. How to implement multithreaded servers?    forums.oracle.com

The problem is not the sockets but the threading. You do not directly call the run method. You call the start method. From the API Javadocs public void start()Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread. The result is that two threads are running concurrently: the current thread (which returns from the ...

8. How to protect server from socket open loop    forums.oracle.com

Hello, I am working in my first Java server. The message flow is like this: 1. Client opens socket (we can get IP address) 2. Server accept socket and creates an object in an ArrayList reserving space for client data 3. Client sends user data 4. Server fill user data in incomplete object How can we prevent an open sockets attack ...

9. Java socket server, urgent help needed    forums.oracle.com

You could try making a method in the ClientWorker like sendMessage(String message), one in the Server like sendMessageToAll(String message, +ClientWorker skip+), and store a list of all ClientWorkers connected. When you receive a message from a client in the ClientWorker, pass the message to the server (and optionally the client that sent it, if you don't want to echo the message ...

10. How to Create a Single Backend Socket connectivity in a Server Socket Pgm    forums.oracle.com

Hi Alan, Will it reset the Server Socket thread or Client Socket ? Because in my case multiple socket connections is getting created at the client side where I used to create the Client Socket. Because the variable "fromclient" is used to accept the connections from the server socket. Is that I have to use the variable "clientsoc" for that ? ...

12. How to communicate with msn search server using java Socket class    forums.oracle.com

Hi All, I am fighting with this can any one help me out... I have given a sample code to try... String query = (keyword+"?q=php"); // String query = ("java"); Socket s = new Socket("search.msn.com/results.aspx", 80); PrintStream p = new PrintStream(s.getOutputStream()); p.print("GET /search?q=" + query + " HTTP/1.0\r\n"); p.print("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0\r\n"); p.print("Connection: close\r\n\r\n"); ...

13. i need a help in creating a socket server ...    forums.oracle.com

i mean i didn't take java yet in the college. and, i'm gonna take it next course. and,the Dr. gave us an assignment to do it in java. and, i ask him to do it in other language(c++) but he insist to do it in java. so, i'm asking for help... i hope it's clear know...

14. server socket programming issue    forums.oracle.com

A couple of things. In future Networking related questions should be posted into the Networking forum. There is too much code here and too much page width. It's a bit overwhelming. You'll need to narrow this down a bit. From looking so far I see some potential portocol related issues. Like the readLine. Are you sure you are always writing line ...

15. Unable to read output from server on a socket    forums.oracle.com

You assume that the Telnet data stream is identical with the stdin/stdout data stream. This is not the case. Fot instance, at the very begining of a Telnet session, a phase called "negotiation" takes place invisibly. You should use an open source Telnet library or learn the telnet protocol from the RFC and do the exchanges accordingly and/or use a network ...

16. Using Server Sockets    forums.oracle.com

Hey guys, I want to use a ServerSocket to make my home computer act as a server for a small instant messenger program I am making (attempting to, at least). I was wondering how to find the IP address I would need to use this as when I do ipconfig from command prompt I get the address of my router. I ...

17. Socket Server problem    forums.oracle.com

My other problem is since my server will ideally run forever, I need to make sure all connections are closed and only the server's socket connection stays open after a client is finished. Currently, (By using a port watching program) when the server starts up it has one port in use. When a client connects there are 4 new connections used ...

18. Server Socket problem..pls help    forums.oracle.com

hi all, i am doing a game in flash which connected to java as a server. this is a multiple client game. Server need to send some data thru server socket to client. how to write if i want the message just send to certain client but not all connected client? any idea about it? please help me. appreciate a lot ...

19. how to shut down the multithreaded socket server    forums.oracle.com

Hi friends Iam developed an Multithreaded Socket server application,in that seperate threads are created for each accept connection of client socket.Each Threads performing the processing of data coming from the client and send back the processed data to the client.In that application i am having idea to put button for shut down the server.If that button is pressed my entire application ...

20. How to check the server socket is alive or not?    forums.oracle.com

Hi, I've an scenario where in one side i've server socket program which listen's client request. another side i've client socket program which connects to that server socket program thro ip address and port number. With this i'm sending messages from client socket to server socket program. In server socket program, i'm receiving messages and printing. Eventhough when i stop the ...

21. Java socket server termination and memory release?    forums.oracle.com

I have the following questions. Pls help me. Thanks! - How to terminate this server gracefully in a Unix/Linux? Now, I simply send a TERM signal to it(though, I didn't write any JNI to handle signals) by "kill -TERM pid". It seems on unix/linux, we can have a JNI code to handle signal so that we can terminate a server by ...

22. How to write a timer to monitor socket server?    forums.oracle.com

I have a program that uses socket in this way: Client A has a socket connection to Server B. A sends some data to B. B processes data and return results to A. However, sometimes, B might take too long to process data and in such a case, for efficiency consideration, A would expect B to simply terminate the processing and ...

23. stale server socket reference    forums.oracle.com

i create a server socket....and in finally clause i close the socket. now most of the time this works fine. however while im still testing my program is crashes sometimes. then removing bind exception is annoying. isnt there anyway (like as it is in jacORB) to check for and remove stale reference on a port??? Message was edited by: luqman

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.