Socket 1 « Client « 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 » Client » Socket 1 

1. Java Socket Programming does not work for 10,000 clients    stackoverflow.com

I can create multiple threads for supporting multi-client feature in socket programming; that's working fine. But if 10,000 clients want to be connected, my server cannot create so many threads. How can ...

2. Server and Client using Sockets    stackoverflow.com

Are there any examples of a server and a client that use sockets, but that have send and get methods? I'm doing this networked battleship program, almost finished, but can't ...

3. Good Client Socket Pool    stackoverflow.com

I need to manage long running TCP socket connections to an external server from my Java application. I'm looking for a good socket pool so I will be able to re-use ...

4. java socket server, client detect server has died    stackoverflow.com

If I kill the Socket Server process, my Socket client process does not receive any errors, it continues to loop forever on the following code:

public void run() {
    ...

5. setSoTimeout on a client socket doesn't affect the socket    stackoverflow.com

I have a Java application with three threads that open, each, a socket and connect to a server on different ports. I set so_timeout on each of these sockets after the connection ...

6. Java Socket Server that services clients serially    stackoverflow.com

Is there a way to implement a socket server that services clients serially.
Generally the practice is to dispatch connected clients to a new thread that services requests and response however amounting ...

7. Transferring HashMap between client and server using Sockets (JAVA)    stackoverflow.com

I am working on a JAVA project in which there are multiple terminals. These terminals act as client and servers. For example if there are 3 terminals A,B and C.Then at ...

8. How can I force the server socket to re-accept a request from a client?    stackoverflow.com

For those who do not want to read a long question here is a short version: A server has an opened socket for a client. The server gets a request to open ...

9. How to develop a client-server seat booking program via java socket programming?    stackoverflow.com


I have a project to develop a client server application in java. This is to be done using socket programming. Our lecturer, used 2 files, the TCPClient.java and TCPServer.java, to make ...

10. How to create client socket using domain name    stackoverflow.com

Hi I am using java for socket programming. To create client socket I have to pass IP and port. But I want to create client socket by passing domain name and ...

11. Writing Async(Or async like) Client Socket Code in Java    stackoverflow.com

I am writing a socket client for interacting with a network service. Currently because I want to support async reading and writing I am threading both the output stream and the ...

12. C socket server, Java socket client : BLOCKING!    stackoverflow.com

I am pasting my code for a simple socket server in C and a Java client. I use write method sending character by character in Java. However after the chunk of characters ...

13. Phantasia4 (Java client & C server) socket timing out    stackoverflow.com

There's an old codebase that uses a server in C and client in Java. The source is here: mudbytes.net/file-890 It used to work just fine years ago, but the socket is now ...

14. Multi-client sockets in Java?    stackoverflow.com

Soon I will be finished with a single-client chat system as a recreational personal project, and I was wondering... Is it simple to convert something like this to have multiple ...

15. Need an example Code of Server Client in java    stackoverflow.com

i need a simple example code of server client communication (Java), in which 1 client is communicating in parallel with 2 servers.

16. Socket client, idle timeout    stackoverflow.com

Is there anyway to set a timeout for a client socket if the client don't get/send any message in a certain time? here is a sniplet of my code :

try {
  ...

17. How do I get the client name from a socket in Java?    stackoverflow.com

Sorry, simple question...but I can't find the answer anywhere using google or in textbooks! I have a simple server, to which a user connects via a socket in java. I want ...

18. Java: Detecting client disconnects from server side    stackoverflow.com

I am writing a Java client/server program using Socket and ServerSocket. Multiple clients connect to the server at once. What is the best way to check if a client connection has ...

19. Release client hangs forever when server has issue (may be socket reset) during calling hessian    stackoverflow.com

I have a client calls to a server through Hessian. During that time the server is not stable and ussually have Socket reset error. And the client was hangs at the ...

20. Java: how to detect in the server, whether a client socket has been closed?    stackoverflow.com

Environment: Java 6, windows xp I am trying to write a client-server TCP socket application. Need to detect on the server, when the client has closed the socket. All the ...

21. Ensuring a client request is delivered the correct response    stackoverflow.com

Looking for suggestions to the following problem. I am working on an application(client) which uses a single TCP socket to read and write messages to a server. A Message is one of ...

22. How to pause a specific string after it has been sent from client to server in java?    stackoverflow.com

I have done a small application that search for Bluetooth devices and gets its Bluetooth address. After getting the Bluetooth address the application will check in a text file (this file ...

23. Java Server and Client Help    stackoverflow.com

I'm trying to write a server and client program in java. I've not done this before, so I figured I'ld start with the examples provided at the links below. Server code:

24. An exception throws when I try to make a Socket to 255.255.255.255    stackoverflow.com

It's my first time programming network in java. I want to use it in a small network. I was looking for a way to send to somehow broadcast to all nodes ...

25. Java sockets server client scenario    stackoverflow.com

This is my problem statement: A multi threaded server sends out periodic message "any clients there". Client machines need to respond with message just to prove that clients do exist on a ...

26. How create servers and clients with socket?    stackoverflow.com

I need to build an app where I have four servers running and one client send some packages to these servers, but these servers have to keep running all the time ...

27. Server Sockets Don't accept clients    stackoverflow.com

I'm learning about sockets in java. I was able to connect a client socket to an online server, but I can connect them to my own server socket!

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

class ...

28. Java Socket Issue: Packets Are Merged At The Receiver Side    stackoverflow.com

I'm having a socket problem. This problem occurs when I'm running the server and client on the same PC i.e. using "localhost" parameter. But problem is not seen when different PCs ...

29. SMTP client stops with HELO command    stackoverflow.com

I have been trying to get this SMTP client up and running. The client reaches the server and is able to send the HELO message. I am also able to get ...

30. Can same program run as Server as well as client for others in java?    stackoverflow.com

I am working on this problem where I have couple of machines on network. Which should communicate with each others with socket. So basic idea is program running on every machine ...

31. Socket programming: Broadcast function sends only to one client    stackoverflow.com

I am creating a program where multiple clients can connect to a server. The message sent by a client will be broadcast to all other client connections on the server. My problem ...

32. Server sockets, multi client, 1 line each    stackoverflow.com

Could someone please give example code of a server socket that connects with multiple client sockets and deals with them sequentially, reading at most one message each from them? For the reading ...

33. How to have clients create a socket for every other client    stackoverflow.com

I need help thinking up a design where clients connect and communicate with all other clients. I'm thinking each client will simultaneously need a ServerSocket for listening for incoming connections from ...

34. Client socket is not receiving a string    stackoverflow.com

I have created a simple client server socket program and sending a string a|b|c|* and the client is not recieving it. The client is on another machine. Server Code.

String format = "a|b|c|*";
ServerSocket ...

35. server client socket programming output difficulties    stackoverflow.com

m new in socket programming...i hv to create a server that stores name & id from a client in a queue and then it stores all the inputs given by the ...

36. How to run Client socket?    coderanch.com

37. client server    coderanch.com

38. activate server by client in socket program?    coderanch.com

As I knew so far, the server is always running and listening to the request from client in socket programming. Is it possible that let the client program activate the server program? For example, I try to write a chat applet (client side) in my homepage, but I don't know how to keep server running in my homepage host. So I ...

39. Simple Socket: From Server to Client    coderanch.com

40. thin clients & fat Clients    coderanch.com

Hi! Well what I know about the FAT and Thin Clients I will say..Please some body correct me if I am wrong. IN the beginning there was a server to serve and a client to be served. Now the client had all the business details in the code so that all the server had to do was throw pages to the ...

41. client and server development    coderanch.com

42. Client Socket Calling Server Socket    coderanch.com

43. How can I make a server and client together with different sockets open?    coderanch.com

Hi all, I have a question about socket programming on server and client. I want to write a server which has one server socket always open to listen to some information. At the same time, the server will automatically send messages to many clients whenever some events happen. I know this is a common way for a server working on-line, but ...

44. Creating a list of clients connected to server?    coderanch.com

Hi there, Im new to this Java ranch, so if this is repeating something I havent seen, I apologise! Ok, my question is, can anyone tell me how to create a list of clients port and InetAddress details as they connect to the server socket. I need to do this so that I can use the details to send messages back ...

45. multi sockets opening in one client    coderanch.com

46. Cut cpu-load while client is running    coderanch.com

Hi! I want that the connection from client to server is alive, until the user close the connection. The client has to read the data all time. I've realized this with an endless-loop. But then, after I'd start the client, the cpu-load was 99%. I don't think that's the way it should. So here my question. Is there a possibility to ...

47. exception in client side    coderanch.com

48. Client socket pool and reuse    coderanch.com

I am trying to create a pool of sockets for subsequent reuse instead of creating a fresh socket everytime. I have trouble in re-using the sockets. Am not sure if I am missing anything here but I run into null-pointer on the socket object(though it is not null) when I try to invoke getOutputStream(). This is only on the second use ...

49. Get list of clients in a LAN.    coderanch.com

50. We need a good java client library rather than server.    coderanch.com

Hi Iain, First of all congrats for writing for what seems to be a good book that fills a void in the market (I had a look at the table of contents). I couldn't help oberving that your book concentrates more on the server and very little information on java clients seem to be given. Most java developers want to make ...

51. Bind in Client    coderanch.com

52. client locating the server.....    coderanch.com

53. Java Client C server    coderanch.com

54. C Server - Java Client    coderanch.com

I am trying to produce a java client to an existing server written in C. The server currently has several clients also written in C, and various messages have been defined (as C structures containing int and char[] etc) which pass between client and server via read/write calls. I am having problems designing a solution, I could read the message as ...

55. Simple Client Socket    coderanch.com

try { String result = null; Socket socket = new Socket("www.yahoo.com", 80); PrintWriter out = new PrintWritesocket.getOutputStream()); String msg = "GET / HTTP/1.1\n"; out.write(msg); out.write(10); // end of line InputStream in = new BufferedInputStream(socket.getInputStream()); byte[] bytes = null; int c; java.util.Vector vec = new java.util.Vector(); while((c = in.read()) != -1) { vec.add(new Integer(c)); } if (vec.size() > 0) { bytes = ...

56. Network Clients    coderanch.com

What is the best way to keep track of a network client when writing a simple two player game server (checkers, tic-tac-toe, etc.) Should I assign a number to each client as soon as they connect to the server? Should I try to recycle the numbers at some point? Perhaps their is a better way I'm not thinking of... Thanks, Drew ...

57. Client Disconnects    coderanch.com

58. how to run no of clients    coderanch.com

60. Assign unique ID to clients    coderanch.com

I am trying to write a chat server and want to assign a unique id to each client that connects to the server. Then, display that id while displaying the text messages. Ex: Client1>Hi Client2>Hello Can someone please suggest how can I do that? I have three major classes: Client.java (which takes care of initiating a connection to the server), ServerListener.java ...

61. Create a secure client server app.    coderanch.com

Hi. I am a little new to this so any help would be a ppreciated. I am writing a small telnet type server that I need to run on an SSH protocol. Are there libs for this? I will also need to create the SSH client that I would like to integrate into an application. Thanks

62. request polling from client machine    coderanch.com

Hi, guys: Here is the scenario: I have a Websphere server whihc sits on a remote machine, I will create a file on the server machine's local file system. Multiple clients (on different machines) will send request ids to populated that file to form a queue of request ids. Now, I have another main client ( on another machine) which will ...

63. Java Client Close Problem with C Server    coderanch.com

I have TCP Server/Client implementation with C/Java. When I close the socket in the JAVA client, the C server is not receiving the closing(SYN) Signal from the client. Actually In C client, when the socket is close, the server is detecting the signal. please! help me to solve this problem.. thanks & regards, stp

64. Client Server -- same socket    coderanch.com

Hi, I have implemeted the client server program where the client sends a file to the server. The server uses a fixed port 1500 to receive the data.But the client responds thro some other PORT!!! i WANT BOTH THE CLIENT AND THE SERVER COMMUNICATE THRO SAME PORT COULD U HELP ME IN THIS? Thanks in advance regards Smitha

65. Server client Application    coderanch.com

Hi Florin, Welcome to JavaRanch. The client will block until the server flushes the output stream unless you are using the new nio package. Check that you are flushing the stream on the server after writing to it. You might want to post your code so we can take a look at it, be sure to use the code button and ...

66. Nonblocking socket for IMAP Client    coderanch.com

I am looking for any pointers for enabling me to write a non-blocking socket type of IMAP client. What does JavaMail do? Can that be used for this purpose? Will that be blocking the calls over the connection.. if yes, what could be the workaround for making it non-blocking? I'd like not to implement the IMAP client spec by myself, and ...

68. Knock-Knock Client    coderanch.com

Originally posted by Lucky Singh: Why are we using out.println() to send message from client to server? Does this mean, my name is being printd on the server? What do I do if I donot want my name to be printed on the server? Is there no method like kksocket.send(fromUser) ? Babies have to learn to crawl before they can walk, ...

69. Client    coderanch.com

Not sure if this the correct forum but i'm trying to write a client which connects to a server and implements an interface ie.formal.one.Connection. The client should send and recieve bytes to request contains of files and directories. The code isn't complete, but the main problem is that when i connect to the server it can't find the correct classes. import ...

70. how can a server PUSH client?    coderanch.com

hello i use the swing write the client-side console,but this client side console fuction not as normal,it don't receive info ACTIVATELY, it works as a monitor to superwise other computer(i call it server),the server push data to the client-side console,that means the swing client PASSIVATELY get info,one info item arrived,the one item is displayed on a table within the client console. ...

71. java client/ c server problem    coderanch.com

72. communicate question for socket server and client    coderanch.com

Hi Hongqing Lu, Your server's socket shuts down as soon as you have sent the first string. The client is still trying to talk to that socket. One way to fix it is to move the "setUpConnection" call into the start of "getResponse" method so that a new socket is set up for each string. You would also need to make ...

73. sockets: How to receive server response in client    coderanch.com

Hello, Just as a warning... I'm new to socket programming. I have a book on the way... but I'm looking for a solution in the meantime. I am sending a message to a server via socket 18011. That server is on a windows platform. Their VB application is acting as the socket server. It is supposed to be sending me a ...

75. Questionare on a local client server    coderanch.com

Hi Hoping to get help with this small problem that i have. I have created a client server socket and the code is complete. I am running this on a stand alone machine. I need the client to be able to call a file from the server and i need the server to get the file and display it to the ...

76. Server to client on a local machine    coderanch.com

Hi Hoping to get help with this small probelm that i have. I have created a client server socket and the code is complete. I am running this on a stand alone machine. I need the client to be able to call a file from the server and i need the server to get the file and display it to the ...

77. Best way to check if client socket has disconnected?    coderanch.com

Hey javaguys! Im programming a chat client and server. The server needs to know when the client has disconnected. I thought it would be enough for the server to check if the socket != null which I thought would occur when the client program was terminated, but this doesnt seem to work. So which is the best way to check if ...

79. client doesn't detect server drop    coderanch.com

My client waits at the select cmd for any data sent to it via the server. The server can drop off unexpectedly and my client should detect this and attempt a reconnect, but it never detects the server is dead. Why doesn't this disconnect trigger an exception? Does it have anything to do with using non-blocking IO? My client will just ...

80. Communicating client interface actions to the server    coderanch.com

Hey, I'm writing a small program that takes user input from a client applet and sends it to the server where it is then processed and a response given. I set it up ok processing typed data at the command line but now I want to interpret clicks on UI components in an applet that I have created. How do I ...

81. Client Server    coderanch.com

Hello, I was wondering if anyone was able to help me. Im trying to write a server which will only allow 3 clients to have active connections; this is the code I am currently using: try { //create a server socket on specified port welcomeSocket = new ServerSocket(port); //try { while (true) { //listen for connection attempts Socket socket = welcomeSocket.accept(); ...

82. Client socket closing.    coderanch.com

Hi When the server disconnects the client, then i have to close the client socket, its giving socketexception but the socket is not closing.How can i do that.. in the socketexception i gave system.out.println.. its keep on displaying. How do i close it once the server disconnects the client. Client has a thread in which i am reading the data from ...

83. Java Head First Client Server Example    coderanch.com

Here's a ready-baked code from the Head First Java book, for the Server and Client codes. The problem I am having is trying to get the client to send a test message, and then receive it back. I can't get it to work. I have added a few lines to the client code to send the test message. Where have I ...

84. client hangs while communicating with server...    coderanch.com

i have a chat server development. i am facing a problem with that. the problem is that if a second client calls this server to get login then the client hangs. the first client that talks to the server logs in and eveything is fine. if second one tries to talk then it causes a problem. i haven't made the client ...

85. fault tolerance client /server    coderanch.com

hi i use a very basic client/server socket program very similar to sun: http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html many client can connect to the server... i would like to add a fault tolerance... a client try to connect a few time... that don't work, the client try to the second server... does a need to do something similar to public class KKMultiServer { public static ...

86. two server and many client....    coderanch.com

hi what i want to do is to create to start 2 tread of server in my class main server.... and each class server start a thread for each connection... example server1 start with port 4444 and server2 with port 4445 all client connect to server1 except if the server is down... my code ServerMain class import java.net.*; import java.io.*; public ...

88. More than one client    coderanch.com

Hi, welcome to the ranch! One way to look at this is that a server cannot send a message to a client at all. A good definition for a server is a process that waits for clients to connect and submit requests. Your desktop PC can take on the server role and the giant blade stack on the raised floor can ...

89. split client on many server...    coderanch.com

hi i have client who connect to a gateway... the gateway have some information about server and port my gateway have a vector who store ipserver adress and another for the port if i have 2 server, i would like the client 1 go to server 1, client 2 go to server 2, client 3 go to server 1...... i search ...

90. Bad clients bringing the server down, help.    coderanch.com

Hello Everybody, I have written a small client server application. The clients connect to the server via a socket. The server creates a new thread for each client connected, and keeps the PrintWriter reference in a Map. Basically, the server reads data from a data source, performs some checks and writes results to connected clients and the client application formats the ...

91. Java client querying web page    coderanch.com

I'm a greenhorn. I'm an experienced (actually, just old) programmer, but new to Java. I've read Head First Java and am trying to muddle through some simple but real initial applications. I'm looking for examples of simple java client apps that query (i.e. submit POST requests with form parameters to) web pages. I can find lots about writing servlets to respond ...

92. multi client problem in chatting    coderanch.com

93. Fail-Over notification to clients,    coderanch.com

Dear Ranchers, we have a server application which starts listening on a port for client connections. We are in the process of building fail-over mechanism into our application. We want to run two instances of this application on two machines, one in active mode and the other in passive mode. When the active server goes down for whatever reasons, the passive ...

94. Finding Clients on a Network    coderanch.com

Hi everyone, I am currently working on a TCP Chat program which allows people to talk to other people on their local network (for now) and was wondering how to do the following: When the user loads up the program I want it to locate all users on the local network running the same software and connect to them. The way ...

95. Using client network from server    coderanch.com

96. Getting the Client machine name    coderanch.com

In my application i need to get the name of the client machine that is making the request. I am using the getRemoteHost method. But it is returning the IP Address of the client. is there any way i can resolve the name of the client machine from that or any other method is there to get the client name. regards, ...

97. discover a client "has gone"    coderanch.com

Hello. I am writing a simple app using a server and several clients, connected through a socket. I want to handle several clients and in the server class I have a Vector which stores each new socket, using something like this: ... conexiones.add(socketServidor.accept()); ... being conexiones the Vector. It is very easy, this way to know when a client connects to ...

98. Need help in a Server - Client Program    coderanch.com

Hi All, I have developed a small utility where in one class i have established a ServerSocket to listen to a particular port and the other class will establish a Socket to that port and send some commands so that the server will act accordingly. I ran the Server in my System and the client in the Other it worked Perfectly. ...

99. BitTorrent client    coderanch.com

Plain sockets. I may have been confused. When you said "Is it possible for client to call methods of tracker while connecting with the other system through sockets" were you thinking object-level method invocation (that would be RMI) or were you thinking simultaneous TCP connections? There's nothing preventing one from connecting simultaneously to the tracker and multiple clients.

100. DETECT if a CLIENT still exits    coderanch.com

hi, i have a server that periodically wait for clients to send files and there are many clients that just send text file to the server. Now i want to write a code that enable the server to know if a client still exits as each clients send a file at a specific interval of time and if one client has ...

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.