What type of stream I need to use to write a connect request message over a tcp socket, to jabber.
I'mwriting a string with xml format. It should worked with the ... |
I've got Java code which makes requests via sockets from a server written in C++. The communication is simply that the java code writes a line for a request and ... |
I'm using the following class to test if a host accepts connection from java
My question is, what could be enhanced here?
Thanks for the feedback
EDIT
I have added the optional parameter "timeout" in ... |
How do you check if you can connect to the internet via java? One way would be:
final URL url = new URL("http://www.google.com");
final URLConnection conn = url.openConnection();
... if we got here, we ...
|
I have built a two-player tic tac toe game in Java, using sockets (no threads). I have it working, except for terminating the clients when the game is over. Basically, I ... |
I tried the below function.This function allows ColdFusion developers to connect to remote hosts through the TCP/IP protocol and transmit messages. Very useful for implementing chat rooms, integrate with third party ... |
We are connecting to a web service as follows:
URL url = new URL("https://...");
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-length", "" + data.length());
conn.setDoOutput(true);
OutputStreamWriter o = new OutputStreamWriter(conn.getOutputStream());
Sometimes, the connection hangs on this last line, ... |
|
I have a client/server set up. The server (Provider.java) will accept 2 Socket connections. Each client, after they connect, are asked what type of game they would like to play - ... |
What's the most appropriate way to detect if a socket has been dropped or not? Or whether a packet did actually get sent?
I have a library for sending Apple Push ... |
I am flex newbie and I am trying to get the example given here :http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_5.html
I am using the same java server given there. and I am creating the XmlSocket in ... |
Search for good Java lib for playing with Sockets connections - Is there any such lib or how to play with sockets from pure Java?
|
My Java.app broadcasts a packet on the network as soon as it starts up. Everytime I start this app, the Mac asks me do I want to allow network connections blah..blah.. ... |
I'm trying to limit the number of connections my server will accept using semaphores, but when running, my code doesn't seem to make this restriction - am I using the semaphore ... |
I'm getting following error when my client tries to connect to my server socket:
java.net.ConnectException: Connection refused: connect
But, my server is really running, on the same machine. I try to connect to ... |
In my application user has to create a new dial up network connection in windows but i want to do this programmatically.Is there any API present in java that can help ... |
Server has couple of ip addresses (let say 1 and 2)
iface eth0 inet static
address 1.1.1.1
netmask ...
|
I think of using in windows a named pipe to communicate between two apps written in Java and C. Normally i use socket connection to do this, but now i have ... |
From what I have read the correct connection string for a jTDS is:
jdbc:jtds:<server_type>://<server>[:<port>][/<database>]
I believe the issue is the server name. The server name is formatted like this
servername\adhoc
An SQLException gets ... |
Ho to connect the java server to flex application?
Is Blazeds plays a role here (or) Remote services?
|
I am using x11vnc and I want to develop simple client for it.
So, the work is:
- recieve info from socket
- send info
- recieve next data
- send another info
and etc.
So, for example, I am using the ... |
So basically the problem is described in the title.
The server works in the following way:
-Listens to a new connection
-Once connection is requested - adds the request to the Q,
-Continues listening to ... |
I have a java socket server, which accepts a connection from the flash client and sends messages to other flash clients connected to the game, it also logs some bits to ... |
How to disable a network connection temporarily in java?
|
This is a class assignment, so I need hints more than answers.
I have a process running on four virtual linux machines. Each process communicates with two of its neighbors. Each ... |
I have a java client and server I'm trying to write Junit tests. In my tests I wait for a connection between the server and client to be made, and ... |
I am having an issue sending some data over a socket, everything works great until I try to send an class that contains:
int playerId
int command ...
|
I'm looking to write a small client-server-based text game that handles multiple client connections and persistently affects a game state. I'm wondering what the best way would be to handle multiple ... |
i tried this code:
http://programming-guides.com/java/tcp-client-server-chat
(full example)
and it's working but when i switch the "host" int the client side to an external IP (insted of localhost) it give me this error:
"Cannot ... |
This is an example of a user defined class I'd like to send from a client application to a server application:
class dataStruct implements Serializable{
byte data;
...
|
I am trying to connect from a J2ee web application to another server(Socket server) which supports one connection TCP connection. The socket server supports one connection from WEB , that means ... |
In Java, if I connect to a client to a server via a socket and the client has an exception which causes it to crash, is there any way the server ... |
I have a problem with my Java program. It has a socket connection between a server and many client. Here is the server (the part which concerns the problem):
private static ArrayList<ParallelServer> ...
|
Is it somehow possible, to test, if a jnp connection is working?
Something like ping would be convenient.
|
I'd like to retrieve the mac address associated to a Msvm_VirtualSwitch. So far I can list all using:
Select * from Msvm_VirtualSwitch
According to this post I should list all Msvm_SwitchPort. ... |
I need to create a socket connection between my machine and a server. Then I need to send some sms to server from my mechine using smpp protocol. Now I am ... |
I'm very interested in how financial data is streamed from server to client. I often here the term 'push-pull' used. I wondered if someone could give me an example (preferably in ... |
My issue is fairly straightforward. My program requires immediate notification if a network connection is lost. I'm using Java 5, so I'm unable to use the very handy features ... |
Ok guys im not that experienced so take it easy on me.
Ok so i have 2 programs, one for the server (my pc) and one for the client(other pcs)
and this is ... |
I have a SWT Java application with a SWT Browser that is displayed on startup to display the news page of my website to the user, and also so the user ... |
Can I use broadband connection(connected by either IPv4 or IPv6) in our java program as like JDBC connection? Or how simply I want to know how to control a broadband connection ... |
In our new project we need to implement a server application. This server gets connection requests of 50,000(+) clients. Problem is these connections have to remain open and have to be ... |
I know that there is a good variant to use Scanner object when you need to get data from server during connetion. But I have question about the following code snippet:
public ...
|
So i have created this program that has a server and a client ... its supposed to connect to other server clients of the same program but on other computers
The problem ... |
I'm building a program in Java that simulates a network of moving nodes. When nodes collide there is a certain probability that they will establish a connection. I'm trying to store ... |
I have a bufferedreader and for some reason it wont read the text from the print stream I am sending from my client. This is the point at which it fails ... |
Is it possible to keep each incoming socket connection in an array and use each whenever we need in Java?
I tried the following Array structure but it throws Exception in ... |
I am building a Client server app in java ,here is my code
Client
import java.net.*;
import java.io.*;
class ClientCode{
public static void main(String args[]) throws Exception {
...
|
I'm making a java program & I want this to be both as server and a client (using sockets). How is this best achieved?
|
anyone knows how to connect to a Mirapoint email server through Java. I am getting Server uses incompatible protocol, it is not SSH-2 compatible Message with Mina. I am able to ... |
I have a typical java client and a server. The client sends some request to the server and waits for the response. The client reads up to say 100 bytes of ... |
I've built a simple Java program that works as a server locally.
At the moment it does a few things, such as previews directories, forwards to index.html if directory contains it, sends ... |
I have a small server and client java-program.
They interact through sockets.
Java server is very simple. It receives Characters from sockets and prints it in console.
import java.net.*;
import java.io.*;
import java.util.Date;
public class DataServerSIMS {
...
|
Possible Duplicate:
Java socket sends some data during connection to server
I have two very very simple java programs - client and server.They establish connection through ... |
@Elaine121 I didn't read all your code but given your description I conclude that you do all your processing in the EDT thread (Event Dispatch Thread). You are keeping that thread ... |
|
Hello. Using a thread i am trying to create a socket. That is Socket mySocket = new Socket(...); At times socket creation is taking a long time. I wish to put a timer on it. Say if it takes more than 'n' seconds, i want the thread to terminate. But the thread is blocking on the socket creation and i am ... |
|
dear sir , I am student of the 3rd year comp science . I am making a project in java for which I have to establish connection to other system through dial up networking ( i.e through modem and telephone line ) but I dont know how to that does java providse any facility for that or it is the property ... |
|
|
|
I meant a computer, or more specifically an IP address. The box the applet is served from will probably be a UNIX machine where your web server is running. It is only to this IP address that an applet can connect to via a socket. Connections to other IP addresses can be made, but only via a server side application. |
|
Hi, i want to open a connection when i log into my application and the connection needs to be persistant till i log out or until i forced to close the connection.so that i can able to send and receive data without opening the connection everytime Kindly post me regarding this query Regards sangeeth |
|
|
Hi! Friends , I got to do one assignment ... case : 1) At a remote location where internet is not available and mobile service provider is not there .. lies my computer with a modem and a telephone line . 2) At some central location there lies a server or a more powerful computer with a modem and a telephone ... |
Hello, I'm writing a jsp(which will shortly be uploaded on our server).Now what i'm trying to do is when a client requests this jsp this jsp would hold the logic to open a socket connection to the client(which has made a request)and write or read a file to/from the client. I want to achieve this without any client side coding/installation. this ... |
|
|
|
The socket is spending an awful lot of time trying to establish the TCP connection to the target IP, and I don't know of a way to tweak this (although such a way may well exist). But really, what seems to be getting in your way is that TCP is an intelligent protocol that handshakes with the other end to guarantee ... |
I have a client applicattion sockets, but i want to check the state of a connection. i don't know how i can do that. I need this control over the connection because when the server closed the connection i can do a send() without errors but the second send() return a 'fail'. i want to control this situation. Sorry but my ... |
|
|
|
|
|
Hello everyone, I have only a small question, and I know one solution, but it's not a pretty one. So I wanted to ask the experts for a better one. My question is: how do I test wether a tcp/ip connection is available or not, without using 'catch' as a way to set a connection boolean to false. for example, I ... |
Hello,friends: I have a question regarding to the swing and web application. Senario: The swing application is used to monitor some activities happened in web application. For example, when a user is login the web application, a signal is showed in swing application the a user has login the web application. The way I am thinking to implement is as following: ... |
|
The situation is : I'm trying to write something onto a socket.... during the process, the connection is lost ( cable is disconnected)... Is there anyway to detect the failure, by catching an exception? Currently, i'm executing the write statements inside a try block and catching any exception which would be thrown.... but it's not throwing any exception and continuing to ... |
hi ranchers could anyone help my to understand the problem in my chatting program 1. in my chatting program i have to peers client and server 2. evrey client have a list of frends when he click on any of them he starts a private chat with his frind. 3. when the client click on his frind name he retreveis his ... |
|
|
|
Hello, i am developing a servlet in which i have to read data from some other web application(at present this another web application is running on different machine, but on same LAN). To do that i establish httpUrlConnection. Following is the code URL externalURL = new URL("http://192.100.100.249:8888/blackbox/servlet/servlet2"); HttpURLConnection connection = (HttpURLConnection)externalURL.openConnection(); // Opening the connection connection.setRequestMethod("POST"); //setting the request method to ... |
|
Hi, I am trying to program a simple server/client socket connection program, the main function is to send and receive objects between them. I somehow went wrong and the connection between them keeps terminating right after establishing connection. Is there anything I can do to resolve this? This is gonnna be kinda long post.. sorry. These are the code that starts ... |
|
If you're writing your own server - a fun and educational experience - you'll have a ServerSocket somewhere that does accept(). This gives you a socket that is connected to the client. If you put all processing of the socket on another thread, the main thread can be ready to accept another connection in no time at all. Here are few ... |
|
Okay, I want to connect to another machine (using a simple socket connection), and then I want to setup my in/out streams so I can send objects over the wire (and also receive them). Can i do this with simple socket connections? For example, I want to send certificate objects through the connection.. (i cannot use SSL) Am i doing it ... |
|
|
|
Hi, I'm building an application that uses a Socket to connect to a server over TCP. When I'm running the application, I sometimes get disconnected (with or without a "connection reset by peer"-error). It's almost sure that the server didn't disconnect me. After I get disconnected, my internet connection is down (also on another computer behind the router), and I have ... |
Your while(true) loop will take any number of clients one at a time. I don't really see how it could take more than one at a time though. Can you confirm that all three clients were connected and sending data at the same time? Did their messages come out mixed up on the console? Here's how I built one of these ... |
|
hi i have problem to connect to server i run the code and i get: ->connection ok and after ->not able to connect to server if i use telnet to connect server, i don't have any problem.. this is the code public void ConnexionServeur(){ Socket kkSocket = null; PrintWriter out = null; BufferedReader in = null; try { kkSocket = new ... |