java connection to jabber

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 default socket stream or a dataoutputstream but it doesn't.


Asked by: Brad849 | Posted: 23-01-2022






Answer 1

Use the Smack client library to connect to a Jabber server, such as OpenFire. It is quite simple to use, you can connect and send/receive messages in a few lines of code.

Answered by: Sawyer269 | Posted: 24-02-2022



Answer 2

You may want to try Openfire (formerly Wildfire). It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber).

Take a look here or for the source here

Answered by: Maddie735 | Posted: 24-02-2022



Answer 3

Jabber is a pretty comprehensive protocol, so I don't think it's really analogous to opening a stream. On the other hand, it's a very well supported protocol, so you have your choice of libraries to help. Here is a link to the relevant information on jabber.org.

Answered by: First Name743 | Posted: 24-02-2022



Similar questions

Java connection to Jabber with only Sockets

What type of stream can I use to send a request message over a tcp socket to jabber. I'm writing a string with xml format. I cant use any libraries. It has to be pure java sockets. the following is the code which i used. But the response for the second xml request is null try { Socket s = new Socket("195.211.49.6", 5222); ...


sockets - Java proxy connection

Im creating several proxy sockets and binding them to another server. Can i create more than 1 instance of the proxy socket? For example having 4 Sockets using the same proxy?


java sockets client single connection

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 once the connection is open its should not close for any request. So my doubts is how can I keep this connection alive for n request & then handle the same getting response for that request it self? (Synchronize it)


sockets - Java chat - connection just on request

I just programmed a Java Server-Client Chat (with multiple clients) where they log in, chat and log out. The socket is always started and I listen in a loop. Now I have to program this kind of chat where the connection isn't always open, so the the connection just stars "on request" (when someone sends a message). How do I do this? Could you give me some keywords which I should google?


Java connection to Jabber with only Sockets

What type of stream can I use to send a request message over a tcp socket to jabber. I'm writing a string with xml format. I cant use any libraries. It has to be pure java sockets. the following is the code which i used. But the response for the second xml request is null try { Socket s = new Socket("195.211.49.6", 5222); ...


Java sockets - Closing a telnet client connection to the server socket


sockets - Connection reset, java

I am getting a lot of connection reset errors, trough debugging i found out that the code is found within these lines: //set up output stream for objects output = new ObjectOutputStream(socket.getOutputStream()); output.flush(); //flush the output buffer to send header information // Read a message sent by client application ois = new ObjectInputStream(socket.getInputStream()); String message = (String) ois...


sockets - Connection reset error when reading data from client java

This question already has answers here:


sockets - Java simple I/O server & client connection reset?

I started learning about networking, sockets three days ago, and I started understanding a few things after I moved to using eclipse IDE. I managed to get the client to work, basically send the input to the server, but when I do so i get the following error: java.net.SocketException: Connection reset That's the full log of the server: Server started. Connected: /127...


sockets - How to make UDP connection between three servers using Java RMI

I am not very much clear about how to make a UDP connection between three servers that are created in a single file by binding them to the registry(interface). Currently i am making a server like this public void exportServer() throws Exception { Remote obj = UnicastRemoteObject.exportObject(this, 2021); Registry r = LocateRegistry.createRegistry(2021); r.bind("NA", obj); } public stati...


sockets - setting timout for connection between server and client in java

My Server program waits for the Client for long time But I want the Server Socket to wait for the Client for only specified time limit, say 2 minutes.How can i set this time limit.I have used timeout on timeout on Server Socket which blocks the connection for the specified timeout Which is not desired.


java - Connection to Oracle without a username or password

Oracle has this concept of allowing database users to be identified by the operating system user who is running the program that is connecting to Oracle. See here. This allows you to do, as that user on a unix machine for example, a command such as: sqlplus / I am attempting to write a Java...


Check LDAP connection (Java)

I'm using javax naming to connect to an LDAP database. Is there a good way to check if a connection is still valid? I'm looking for something really efficient here because it may need to be done often. After some web searching all I have found is a suggestion to do a quick search, is there any more lightweight way? /mac


java - How to determine database type for a given JDBC connection?

I need to handle resultsets returning stored procedures/functions for three databases (Oracle, sybase, MS-Server). The procedures/functions are generally the same but the call is a little different in Oracle. statement.registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR); ... statement.execute(); ResultSet rs = (ResultSet)statement.getObject(1); JDBC doesn't provide a generic way to ha...


spring - How can I set up an LDAP connection pool in a Java EE Container?

I need to put an LDAP contextSource into my Java EE container's JNDI tree so it can be used by applications inside the container. I'm using Spring-LDAP to perform queries against ORACLE OVD. For development, I simply set up the contextSource in the Spring xml configuration file. For production, however, I need to be able to use a JNDI lookup to grab the connection/context from the container (as suggested here:


Java connection to / between Microsoft Windows Office Suite?

I read elsewhere (a response by "hazzen" here) that .NET has "a binding for the entire Office suite outlined here that allows you to write COM-based methods that you can call from Office. It is intended for automation, but you can write any managed code you want and have Excel call into it." I'...


java - Android HTTP Connection

Can anybody tell my why this doesn't work in the Android emulator? From the browser I have access and the server is internal. All I can think of is that I'm missing some configuration on my app so it can access the network layer. try { InetAddress server = Inet4Address.getByName("thehost"); //Doesn't work either //or InetAddress server2 = Inet4Address.getByAddress(new String("192.168.1.30").getB...


java - How to create an SSL connection using the Smack XMPP library?

I'm building a small program that acts as an XMPP client and I am using the Smack library. Now, the server I am connecting to requires SSL (in Pidgin I have to check "Force old (port 5223) SSL"). I'm having trouble getting Smack to connect to this server. Is it possible?


java - HTTP Connection Pooling in GlassFish

In my webservice, I need to place some HTTP calls. Is it possible to do some connection pooling, like I do JDBC connection pooling? In the Admin Console of GlassFish I see the configuration items Connector Connection Pool and Connector Resources. Can I use these?


java - Proxool maximum connection count

I'm using proxool java connection pool (version 0.9.1). Everything works fine till I reach the maximum connection count. If the maximum connection count is reached proxool immediately throws an SQLExcepion: java.sql.SQLException: Couldn't get connection because we are at maximum connection count (n/n) and there are none av...


java - How can multiple webapps in the same tomcat instance share database connection pool?

Having in mind that each webapp has its own separate database (but all databases are in the same database server). The scenario is that I have a multi-tenant saas application - I deploy the same application for each customer. Each customer works on a database that is called db_cid, where cid is the customer id, i.e. a a unique customer identifier. Working with hibernate.






Still can't find your answer? Check out these amazing Java communities for help...



Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)



top