Developing a chat server ...
Dear all
I am planning to develop a chat server to be used locally in my company. I want the members of this server to be able to connect to thier msn and yahoo messenger contacts.
Is it possible? How can I do it? detailed explaination, please.
even give any useful links...
Best Regards
do you mean some program like JBuddy Messenger,
you can try this, it is a good example.
currently it supports AIM, MSN, ICQ, Yahoo and JBuddy protocol.
Similar Messages
-
My simple chat server does not send messages to connected clients
Hi!
I´m developing a chat server. But I can not get it work. My client seems to make a connection to it, but my server does not send the welcome message it is supposed to send when a client connects. Why not?
removedEdited by: Roxxor on Nov 24, 2008 10:36 AMOk, I solved my previous problem and now I have got a new really annoying one.
This is a broadcasting server which meand it can handle multiple clients and when one client sends a message to the server, the server should broadcast the message to all connected clients. It almost works, except that the server just sends the message back to the last connected client. The last connected client seems to steal the PrintStream() from the other clients. How can I solve that?
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.lang.Character;
import java.io.OutputStream;
import java.util.Vector;
public class ChatServer extends MIDlet implements CommandListener, Runnable
private Display disp;
private Vector connection = new Vector();
private TextField tf_port = new TextField("Port: ", "", 32, 2);
private Form textForm = new Form("Messages");
private Form start_serverForm = new Form("Start server", new Item[] { tf_port });
private Command mExit = new Command("Exit", Command.EXIT, 0);
private Command mStart = new Command("Start", Command.SCREEN, 0);
private Command mDisconnect = new Command("Halt server", Command.EXIT, 0);
ServerSocketConnection ssc;
SocketConnection sc;
PrintStream out;
public ChatServer()
start_serverForm.addCommand(mExit);
start_serverForm.addCommand(mStart);
start_serverForm.setCommandListener(this);
tf_port.setMaxSize(5);
textForm.addCommand(mDisconnect);
textForm.setCommandListener(this);
public void startApp()
disp = Display.getDisplay(this);
disp.setCurrent(start_serverForm);
public void pauseApp()
public void destroyApp(boolean unconditional)
public void commandAction(Command c, Displayable s)
if(c == mExit)
destroyApp(false);
notifyDestroyed();
else if(c == mStart)
Thread tr = new Thread(this);
tr.start();
else if(c == mDisconnect)
try
sc.close();
catch(IOException err) { System.out.println("IOException error: " + err.getMessage()); }
destroyApp(false);
notifyDestroyed();
public void run()
try
disp.setCurrent(textForm);
ssc = (ServerSocketConnection)Connector.open("socket://:2000");
while(true)
sc = (SocketConnection) ssc.acceptAndOpen();
connection.addElement(sc);
out = new PrintStream(sc.openOutputStream());
textForm.append(sc.getAddress() + " has connected\n");
ServerToClient stc = new ServerToClient(sc);
stc.start();
catch(IOException err) { System.out.println("IOException error: " + err.getMessage()); }
catch(NullPointerException err) { System.out.println("NullPointerException error: " + err.getMessage()); }
class ServerToClient extends Thread
String message;
InputStream in;
SocketConnection sc;
ServerToClient(SocketConnection sc)
this.sc = sc;
public void run()
try
in = sc.openInputStream();
int ch;
while((ch = in.read())!= -1)
System.out.print((char)ch);
char cha = (char)ch;
String str = String.valueOf(cha);
out.print(str);
//broadcast(str);
textForm.append(str);
in.close();
//out.close();
sc.close();
catch(IOException err) { System.out.println("IOException error: " + err.getMessage()); }
} -
I'm developing a chat server and I am handling it with threads. I developed a executable class to handle all and I'm putting all the users in two Hashtables. There are two kinds of users. I need to know how many users do you gurus believe it can support? and how could I make it better. Thanks
Ivanthe way you do it is okay and the size of the hashtables is just limited by the space the jvm has and the kind of keys you are using.
regards -
hai,
i am newbie in javapgms. I need to develop simple socket programmms for my lab including chat server.
PLZ HELp.
byehai,
i am newbie in javapgms. I need to develop simple
socket programmms for my lab including chat server.
PLZ HELp.
byeHai Bon Jovi,
I liked your hits, especially the one that goes:
"Shot thru the heart, and you're to blame, you give programmers a bad name". -
How do i develop a chat application using jms over web based
I want to develop a chat application using jms with mailing,file transfer and audio facilities
can anyone help me to how to go abt thatThere is a good article from Sun on a simple example of what you want - it could serve as a basis for you.
http://developer.java.sun.com/developer/technicalArticles/peer/ -
Doubts over the Performance in Developing a Chat application
We are developing a chat application which needs to update the chat content in the database for the duration of the chat (ie.,For the duration of a session).At the same time the page should refresh and show the current content on both ends.In addition to both these, the database tables has to be checked to detect the occurence of a Network error on both sides.
We have developed it as a Browser based chat and we have used PHP with MySQL. The performance is slow.
Can anyone give a suggestion as to whether we can develop the chat application completely from the scratch and if we do that which technology should we choose to boost the performance.
If anyone is not clear about my problem just mail me.I'll explain it in more detail.
Thanks in AdvanceHi,
I just wanted to know these following answers.
2) Network failure -- Means (either browswer got killed or data did not arrived/Page Not refreshed)
3) which WebSErver are U using?
From java, it is very easy to develop chatting application for which you can use applet and servlets for the same (if you consider the performance is the utmost importance)
Updating to the database should not be done for the duration levels rather should be done at the event levels(data change/keyboards/session -inf changes).
Im not sure about PHPs running at client but I can suggest you to use two frames .One is for typing and other one is for displaying information which basically gets the staus from the server abt other users in the chat either from the session, which would be driven by other component which is static) .
Any how, I just put my ideas (Im sure , you know all these things)
with regards
Lokesh T.c -
Okay, so I want to develop a chat system much like AIM. I have a few problems: Even though I believe that Java is the best language for something like this, the server I am working on doesn't support it. I can only run PHP and CGI scripts. Is there a way to do this with only PHP or CGI?
Here are a few of my ideas:
Create either a JAVA applet or a JAVA downloaded program that users can use to chat. When they log in, they call a CGI or PHP script that places their username and IP address into a database. They can query the database to see who else is logged in and then create a direct P2P connection using that IP address. Nice? The problems: Can JAVA applets interact that way? If not, it would have to be a JAVA program that is downloaded. The disadvantages of that are obvious. Also, in order to keep a running list of online users, the program would have to query the script constantly. That would severely bog down the server. My only other option is to have users blindly IM users and if they're on, they're on. if not, they're not. That's not user-friendly at all.
What do you guys suggest? I need help on this asap.Hi threre,
I think that the only "problem" in a P2P chat system is the IP exchange. This is the only reason why a server is needed. You can create the program in java whithout problem. The program will accept the IP somehow and start. This "somehow" will depend on the server. So imho it shouldn't be intergrated in the main program.
Also, an Applet is running on the local computer, so the IP will be the local user's IP. That means there is no problem.
I have no idea about php and cgi, so i can't help you on the IP-exchange system.
CU -
Need some help on JAVA CHAT SERVER
i need some info about java chat server. Please any one who have developed give me the details about the logic and process flow.
Have you read any of these?
http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2B%22chat+server%22&col=javaforums -
Hi
I have developed Chat Application. It's working good in Intranet. But it's not working in Internet. This is b'cause , Chat Server is behind the firewall. So how can I set in Firewall that if any request comes for the port(2004) , it can transfer to the System, where the Chat server is running.
With Regards
Santhoshhey, i though all the firewalls had the same FM ?!?!
Hahaha! -
Development and Quality server using different screen color setting
Hi,
I want to differentiate the Development and Quality server using different screen colors,
How can I set different color logon screen for the different kinds of servers.
Thank You.
Best Regards,
M.Thirumoorthi
[email protected]Hi Thiru moothi,
Please check these links :
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/ep/modifyingtheLogon+Page&
Custom Password Change Page
Custom Portal Logon Page
Reward points if handy!
Cheers,
Sandeep
Edited by: Sandeep Tudumu on Mar 26, 2008 7:41 PM -
Trying to produce a java chat server
Would like produce a working client/server chat system, as basic as possible but able to listen and talk to each other. Any chat servers how-to examples I've come across never seem to work.
Would like to understand why applets don't work when I open the web page but do work when I view using the appletviewer. I use Internet Explorer 4 i think, java version 1.3.0_02
would you understand at least part of this error which appears when I run a chat server
exception:com.ms.security.SecurityExceptionEx[Client.<int>]:cannot access "194.81.104.26":5660
(the error is all one line no spaces)
the following code is one of the programs I've been working on and I receive the above error, appletviewer doesn't work so i think that means something is wrong with the code, client side as the server side works well, it listens etc
// Client side
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
public class Client extends Panel implements Runnable
// Components for the visual display of the chat windows
private TextField tf = new TextField();
private TextArea ta = new TextArea();
// The socket connecting us to the server
private Socket socket;
// The streams we communicate to the server; these come
// from the socket
private DataOutputStream dout;
private DataInputStream din;
// Constructor
public Client( String host,int port ) {
// Set up the screen
setLayout( new BorderLayout() );
add( "North", tf );
add( "Center", ta );
// Receive messages when someone types a line
// and hits return, using an anonymous class as
// a callback
tf.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent e ) {
processMessage( e.getActionCommand() );
// Connect to the server
try {
// Initiate the connection
socket = new Socket( host, port );
// Recieved a connection
System.out.println( "connected to "+socket );
// Create DataInput/Output streams
din = new DataInputStream( socket.getInputStream() );
dout = new DataOutputStream( socket.getOutputStream() );
// Start a background thread for receiving messages
new Thread( this ).start();
} catch( IOException ie ) { System.out.println( ie ); }
// Called when the user types something
private void processMessage( String message ) {
try {
// Send it to the server
dout.writeUTF( message );
// Clear out text input field
tf.setText( "" );
} catch( IOException ie ) { System.out.println( ie ); }
// Background thread runs this: show messages from other window
public void run() {
try {
// Receive messages one-by-one, forever
while (true) {
// Get the next message
String message = din.readUTF();
// Print it to our text window
ta.append( message+"\n" );
} catch( IOException ie ) { System.out.println( ie ); }
// ClientApplet
import java.applet.*;
import java.awt.*;
import java.io.*;
import java.net.*;
public class ClientApplet extends Applet
public void init() {
//String host = getParameter( "host" );
String host="194.81.104.26";
//int port = Integer.parseInt( getParameter( "port" ) );
int port =5660;
setLayout( new BorderLayout() );
add( "Center", new Client( host, port ) );
// server
import java.io.*;
import java.net.*;
import java.util.*;
public class Server
// The ServerSocket is used for accepting new connections
private ServerSocket ss;
// A mapping from sockets to DataOutputStreams. This will
// help us avoid having to create a DataOutputStream each time
// we want to write to a stream.
private Hashtable outputStreams = new Hashtable();
// Constructor and while-accept loop all in one.
public Server( int port ) throws IOException {
// listening
listen( port );
private void listen( int port ) throws IOException {
// Create the ServerSocket
ss = new ServerSocket( port);
// ServerSocket is listening
System.out.println( "Listening on "+ss );
// Keep accepting connections forever
while (true) {
// The next incoming connection
Socket s = ss.accept();
// Connection
System.out.println( "Connection from "+s );
// Create a DataOutputStream for writing data to the
// other side
DataOutputStream dout = new DataOutputStream( s.getOutputStream() );
// Save this stream so we don't need to make it again
outputStreams.put( s, dout );
// Create a new thread for this connection, and then forget
// about it
new ServerThread( this, s );
// Get an enumeration of all the OutputStreams, one for each client
// connected to us
Enumeration getOutputStreams() {
return outputStreams.elements();
// Send a message to all clients (utility routine)
void sendToAll( String message ) {
// We synchronise on this because another thread might be
// calling removeConnection()
synchronized( outputStreams ) {
// For each client ...
for (Enumeration e = getOutputStreams(); e.hasMoreElements(); ) {
// ... get the output stream ...
DataOutputStream dout = (DataOutputStream)e.nextElement();
// ... and send the message
try {
dout.writeUTF( message );
} catch( IOException ie ) { System.out.println( ie ); }
// Remove a socket, and it's corresponding output stream, from our
// list. This is usually called by a connection thread that has
// discovered that the connectin to the client is dead.
void removeConnection( Socket s ) {
// Synchronise so sendToAll() is okay while it walks
// down the list of all output streams
synchronized( outputStreams ) {
// Removing connection
System.out.println( "Removing connection to "+s );
// Remove it from our hashtable/list
outputStreams.remove( s );
// Make sure it's closed
try {
s.close();
} catch( IOException ie ) {
System.out.println( "Error closing "+s );
ie.printStackTrace();
// Main routine
// Usage: java Server <port>
static public void main( String args[] ) throws Exception {
// Get the port # from the command line
int port = Integer.parseInt( args[0] );
//int port = 5000;
// Create a Server object, which will automatically begin
// accepting connections.
new Server( port);
// ServerThread
import java.io.*;
import java.net.*;
public class ServerThread extends Thread
// The Server that spawned
private Server server;
// The Socket connected to our client
private Socket socket;
// Constructor.
public ServerThread( Server server, Socket socket ) {
// Save the parameters
this.server = server;
this.socket = socket;
// Start up the thread
start();
// This runs in a separate thread when start() is called in the
// constructor.
public void run() {
try {
// Create a DataInputStream for communication; the client
// is using a DataOutputStream to write to us
DataInputStream din = new DataInputStream( socket.getInputStream() );
// Over and over, forever ...
while (true) {
// ... read the next message ...
String message = din.readUTF();
// ... sending printed to screen ...
System.out.println( "Sending "+message );
// ... and have the server send it to all clients
server.sendToAll( message );
} catch( EOFException ie ) {
// This doesn't need an error message
} catch( IOException ie ) {
// This needs an error message
ie.printStackTrace();
} finally {
// The connection is closed for one reason or another,
// so have the server dealing with it
server.removeConnection( socket );
<body bgcolor="#FFFFFF">
<applet code="ClientApplet" width=600 height=400>
<param name=host value="127.0.0.1">
<param name=port value="5660">
[Chat applet]
</applet>
</body>Hi!
Go to
http://www.freecode.com/projects/jchat-java2clientserverchatmodule/
probably u will het the answer..
Jove -
Will the reports developed in sql server 2008 r2 BIDS work when deployed on sql server 2012 reporting manager?
when I check on Microsoft site it says
Reports are not upgraded when you upload a report definition file directly to the report server
or SharePoint site. Upgrading a report definition in SQL Server Data Tools is the only way to upgrade the .rdl file.
When you open an .rdl file in Report Designer in SQL Server Data Tools (SSDT), if the report was
created for a previous namespace, Report Designer automatically creates a backup file and upgrades the report to the current namespace.
This is the only way you can upgrade a report definition file.
Now here is another confusing statement which says
You can upload an .rdl file created in an earlier version of Reporting Services to a SQL Server
2012 report server and it is automatically upgraded on first use. The report server stores the report definition file in the original format. The report is automatically upgraded the first time it is viewed, but the stored report definition file remains
unchanged.
All I want to know is if I deploy a rdl made in 2008 r2 to 2012 will it work on the report manager of
2012?
<o:p>
</o:p>
MudassarI have tested this fucntionality and can confirm that ssrs 2008 r2 reports work when you deploy them on new ssrs 2012 report manager .
No Migration is required .
I didnt even moved report server dbs .All I did is just deployed reports on the report manager and it worked .
"You
can upload an .rdl file created in an earlier version of Reporting Services to a SQL Server 2012 report server and it is automatically upgraded on first use. "
Microsoft needs to correct this the documentation is misleading
Mudassar -
Lync 2010 client connecting to 2013 persistent chat server
Since we never had Group Chat in our 2010 environment, I have no idea how it works and now that we have 2013 Persistent Chat, I am struggling with getting the Lync 2010 connected. The 2013 client works just fine as it is integrated into the client. I found
out Lync 2010 needs a separate Chat client to run along side the IM client.
I installed this client but from there I have no idea how to connect it to the 2013 Chat server. I created the endpoint on the Lync 2013 server according to the article
http://technet.microsoft.com/en-us/library/jj204901.aspx but something else needs to be done. I just don't know what. Not even sure where to start looking. Many of our Lync clients have
to use 2010 because the OS is XP so I need to find out how to get these users to work with Persistent Chat.
I am not sure what the point is of creating the End point according to the article. I am sure its necessary but not sure how it fits into the clients using it to connect. What does the article mean when it says "Next, configure Persistent Chat clients
to use that SIP address as their contact object". Do you need Group Chat functioning in 2010 for this to even work?
The problem is we never had Group Chat with 2010 so I am sure there are some settings missing like DNS records etc...If you have users running legacy clients (such as Microsoft Lync 2010 these users might find the default Persistent Chat URIs difficult to work with and difficult to use when pointing their legacy client towards the pool. Because of this,
administrators need to use the New-CsPersistentChatEndpoint cmdlet to create an additional contact object for the pool, a contact object that provides a friendlier, easier-to-use URI.
Lisa Zheng
TechNet Community Support -
Development Environment for Server APIs in Webcenter Interaction 10.3
Hi, I installed “Oracle Web Center Interaction 10.3" on standard environment mentioned by oracle (Window 2003 server, IIS6.0, SQL Server 2005). Everything works fine concerning the portal and services.
I also have visual studio 2005 on the same machine and trying to setup a development environment where I can user server APIs (I start with creating IPTSession).
I am using follwong code to start with:
/String serverConfigDir = ConfigPathResolver.GetOpenConfigPath();
IOKContext configContext = OKConfigFactory.createInstance(serverConfigDir, "portal");
PortalObjectsFactory.Init(configContext);
IPTSession ptSession = PortalObjectsFactory.CreateSession();
Problem: code compiles if I add few dlls, but it do not run, it throws following error
com.plumtree.openkernel.exceptions.OKFactoryException: Error in AOKFactory.createAndInitializeInstance, unable to create object with name 'com.plumtree.openkernel.impl.config.Config' in assembly or JAR file 'openconfig'.
I think either server APIs are not more supported in 10.3 or I do not know how to setup the development environment for server APIs.
Can anyone help??i have already tried putting hardcoded path but it didn't help, morover the previous line gives me correct path.
I issue i mentioned seems to be related with some setting or missing native dlls
com.plumtree.openkernel.exceptions.OKFactoryException: Error in AOKFactory.createAndInitializeInstance, unable to create object with name 'com.plumtree.openkernel.impl.config.Config' in assembly or JAR file 'openconfig'.
i got follwing extract from the wsserver-wrapper.log file
INFO | jvm 1 | 2009/02/20 12:26:17 | 2-20-2009 12:26:17.606 Info OpenKernel.Config Disabled-1235112977434 WrapperStartStopAppMain com.plumtree.openkernel.impl.config.providers.ConfigXMLFileProvider Loading config data from C:\bea\alui\ptws\10.3.0\bin\..\..\..\common/../settings
INFO | jvm 1 | 2009/02/20 12:26:18 | 2-20-2009 12:26:18.325 Info OpenKernel.Config Disabled-1235112977434 WrapperStartStopAppMain com.plumtree.openkernel.impl.config.providers.ConfigXMLFileProvider Setting subscription data.
INFO | jvm 1 | 2009/02/20 12:26:18 | container config context:EAS:wsserver
i didn't modified anything in any config file, just configured everything on one machine with oracle configuration manager -
J2ME J2EE(servlet jsp) chat server
want to make a chat server using J2ME(fronend) and J2EE(server) . Could anybdy tell me some sample applications on the net or tutorials that can help
Darryl.Burke wrote:
Why, is Google broken?Hey you dont have to be rude to the guy ... suggest a few or dont reply
Maybe you are looking for
-
Data Selection in Info Package
Hi Gurus: How to exclude say doc type 'ER' in a Info package...Where can I mention the <> operator in I.pKG.. Thanks & Regards
-
Just downloaded software update and now have an indicator I've never seen before appearing on the phone in the upper right corner next to the battery indicator. Can't even really describe it except to say that it looks like a phone handset in the "hu
-
After I purchased Toshiba LE 24L4200U, I can not watch local channels without TV provider How can I fix or do to watch local channels on TV like used to be.? Taira
-
Pioneer Receiver, can't figure out how to get sound out of it
I bought a Pioneer receiver along with my TV and Blu-Ray at BB. Hooked it up; Blu-ray and Cable to Receiver (both HDMI) and single HDMI output to TV. Use HDMI thru-put but it won't allow me to direct sound to the speakers hooked up to the receiver. I
-
Spark Datagrid: Styling the Header?
Hi, Question for all the Spark and Datagrid gurus out there: How can I change the text style of the spark datagrid header? For example, I want to make it blue with underlines. More importantly I need to change the color on rollover and/or selection