Chat between j2me clients and using a Servlet server

Java gurus, please help me..
I'm wondering if I could set up a sort of chat functionality between two j2me clients. I wish to use Java servlets as my server and Tomcat to deploy it. Is this possible? Can i do these by using http connection only or do i have to use sockets? If i use sockets, how will i configure Tomcat, or do i still need Tomcat?
Hope someone could help! Thanks in advance! =)

Basically it means you should have a Thread that loops and make an http request every x seconds. Before sending the request it should check if the user has typed anything, and send that with the request. The server should keep track of all the chat messages sent, and forward to all the other clients when they request an update. To keep track of what clients have received what messages, you could have a time stamp for each message, and a "last update" field for each client.
The client should run something like this in a thread:
while (iAmRunning) {
  url = "......." // address of your server
  if (the user typed anything since the last time we sent a request) {
    url = url + "?msg=" + whatTheUserTyped; // maybe another parameter for private messages?
    reset what the user typed (so it won't be sent next time);
  send the request;
  get the response containing what the rest of the users have
    typed since my last update;
  update the display with the latest messages;
}And the server would handle a request like:
if (the request contains a message) {
  save the message with the current time;
check when was the previous update for this user;
get all messages where the timestamp is later than the last update;
set the last update field for the user with to the current time;
respond with all the messages;

Similar Messages

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • Diff between Thin client and Rich client

    Hi Everyone,
              Can someone give me a clear picture of the what is the diff between Thin client and Rich client.
    Thanks,
    Krishna

    Hi,
    thick client (rich client) has/stores all the data inside itself
    so it can do application processing without the server with data
    thin client uses resources from host computer (from server)
    and wihtout that you are not able to work with that kind of client
    does that answer your question ?
    Regards,
    michal

  • Error 2032 in communication between Flex Client and WCF

    Hi All,
    I'm trying to establish communication between Flex Client
    and WCF service.
    WCF service accepts gZip compressed data and returns gZip
    compressed results.
    So I used Flex ByteArray.compress() and
    ByteArray.uncompress() for this purpose. However, it throws error
    2032.
    The gZip compression/decompression uses MemoryStream class in
    C#. Based on my previous experience, memory stream communication
    between Flex and C# gives erro 2032.
    Is there a work around for this?
    Thanks,
    Vishal

    I read some thread in the forum, and found somebody had the similar problem with me. Just want to know how to settle this problem.
    In the client/server program. Client is a JAVA program and Server a
    VC++ program. The connection works, and the problem appears after some time. The Client sends a lots of requests to Serverm, the server seems receive nothing. But at the same time, the server is able to send messages to Client. The Client also can get the messages and handle them. Don't understand why there this problem and why it appears when it wants.
    The client is a Win2k platorm with JDK1.3.1 and the server is also a Win2K platform with VC++ 6.0.
    In the Client, using:
    inputFromServer = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    outputToServer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);
    Hope can get your help.

  • Difference between instant client and full oracle client

    Everyone,
    I had read the below lines from a goldengate pdf. Someone please explain me what is the difference between instant client and full oracle client?
    What is the use of XDK libraries.?
    " The full Oracle client must be used with GoldenGate so that the GoldenGate programs
    have access to the Oracle XDK libraries. Do not use Oracle Instant Client, which lacks
    those libraries. You can download the full client from Oracle’s website."
    Regards,
    SAKTHi

    The dealio is this:
    When you install client software, you have several options as to the degree of what you get/install. The big chicken dinner is administrator, so you get all kinds of extra features, add-ons, libraries, utilities, etc. At the hard candy Christmas end is instant client, and that has just enough functionality to, as you may surmise by now, connect a client and that's about it. Various libraries have functionality built in to do whatever extra is required. An example is FAN, or fast application notification, used in Data Guard failover. A FAN API (Java) will detect a failover and re-direct a client connection to the new primary. What GG uses XDK for (specifically) isn't of importance to a user, just the fact that it is available for connecting to Oracle is.

  • Difference between Golden Client and Master Client

    Dear,
    What is the Difference between Golden Client and Master Client?
    Thanx & Regards,
    Mohammad Nabi,
    [email protected]

    Golden Client is similar or is the the same as Development Client, which should not be used for testing.
    Master Client ???
    Note on SAP Landscape:
    Landscape is like a server system or like a layout of the servers or some may even call it the architecture of the server’s viz. SAP is divided into three different landscape DEV, QAS and PROD.
    -  DEV would have multiple clients for ex: 190- Sandbox, 100- Golden, 180- Unit Test.
    -  QAS may again have multiple clients for ex: 300- Integration Test, 700 to 710 Training.
    -  PROD may have something like a 200 Production.
    These names and numbers are the implementer's discreet on how they want it or they have been using in their previous implementations or how is the client's business scenario. 
    Now whatever you do in the Sandbox doesn't affect the other servers or clients. Whenever you think you are satisfied with your configuration and you think you can use it moving forward, you RE-DO it in the golden client (remember, this is a very neat and clean client and you cannot use it for rough usage). As you re-do everything that you had thought was important and usable, you get a transport request pop up upon saving every time. You save it under a transport request and give your description to it. Thus the configuration is transported to the Unit Test client (180 in this example). 
    You don't run any transaction or even use the SAP Easy Access screen on the 100 (golden) client. This is a configuration only client. Now upon a successful transport by the Basis guy, you have all the configuration in the Testing client, just as it is in the Golden client. The configuration remains in sync between these two clients. 
    But in the Testing client you can not even access SPRO  (Display IMG) screen. It's a transaction only client where you perform the unit test. Upon a satisfactory unit test, you move the good configuration to the next SERVER (DEV). The incorrect or unsatisfactory configuration is corrected in Golden (may again as well be practised in the sandbox prior to Golden) and accordingly transported back to 180 (Unit Test) until the unit test affected by that particular config is satisfactory. 
    The Golden client remains the 'database' (if you wanna call it that) or you may rather call it the 'ultimate' reference client for all the good, complete and final configuration that is being used in the implementation.
    In summary:
    Landscape : is the arrangement for the servers
    IDES : is purely for education purpose and is NOT INCLUDED in the landscape.
    DEVELOPMENT ---> QUALITY -
    > PRODUCTION
    DEVELOPMENT : is where the the consultants do the customization as per the company's requirement.
    QUALITY : is where the core team members and other members test the customization.
    PRODUCTION : is where the live data of the company is recorded.
    A request will flow from Dev->Qual->Prod and not backwards.
    1. Sandbox server: In the initial stages of any implementation project, You are given a sandbox server where you do all the configuration/customization as per the companies business process.
    2. Development Server: - Once the BBP gets signed off, the configuration is done is development server and saved in workbench requests, to be transported to Production server.
    3. Production Server: This is the last/ most refined client where the user will work after project GO LIVE. Any changes/ new development is done is development client and the request is transported to production.
    These three are landscape of any Company. They organized their office in these three way. Developer develops the program in Development server and then transport it to test server. In testing server tester check/test the program and then transport it to Production Server. Later it will deploy to client from production server.
    Presentaion Server- Where SAP GUI has.
    Application Server - Where SAP Installed.
    Database Server - Where Database installed.
    Regards,
    Rajesh Banka
    Reward points if helpful

  • NFS problem between RedHat Client and Solaris Server

    Hi all, we are experiencing a problem between a RedHat client and a Solaris 10 server. For the purposes of this post, I'll call the Redhat client server A and the Solaris 10 server B.
    Server B is exporting a filesystem that server A is trying to mount. Server A can successfully mount the exported file system, however, strange things are happening. If I change to the exported mount point on server A and create a file, the file is owned by nobody:nobody, not the user that created the file.
    A look at the file on server B shows the file has the correct UID and GID (ie the UID & GID of server A).
    The fstab file on server A looks like this:
    serverB:/data /data nfs4 rsize=32768,wsize=32768,hard,nointr,rw,bg,actimeo=0,timeo=300,suid 0 0
    Does anyone have a explanation for this?
    NB: There is a firewall between server A and server B. A firewall rule is in place to allow traffic between the two servers on port 2049
    Stewart

    Hi
    If I change to the exported mount point on server A and create a file, the file is owned by nobody:nobody, not the user that created the file.On a NFS share, for security reasons, you normally dont have root provileges.
    A file createt as root user will be mapped to nobody:nobody.
    The behaviour you see is correct.
    If you want the file to be createt as root, you have to export the filesystem with -o ro,anon=0
    NFSv3 will be blocked by your firewall.
    Franco

  • Difference between copy value and use one as many

    hi
    what  is the difference between copy value and use one as many?
    thanks

    [http://help.sap.com/saphelp_nw2004s/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm]
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm]
    Much better understanding of UseOneAsMany: [http://help.sap.com/saphelp_nw2004s/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm]
    Edited by: Praveen Gujjeti on Feb 18, 2010 11:42 AM

  • Difference between native client and workstation client.

    hi,
    I am confused with the difference between native client and workstation client.In
    some docs,it is said that native client is one which run on the same system as
    the server,in other it is said running on other machine in the same domain.So
    what about workstation client?So can anyone please helpme out in knowing this
    difference?

    subhash wrote:
    hi,
    I am confused with the difference between native client and workstation client.In
    some docs,it is said that native client is one which run on the same system as
    the server,in other it is said running on other machine in the same domain.So
    what about workstation client?So can anyone please helpme out in knowing this
    difference?The simple answer is that /WS clients are compiled with the -w option.
    The complicated answer has to do with how the client connects to Tuxedo during the
    tpinit(), and all subsequent traffic. A Tuxedo Domain (instance) has a Bulletin
    Board, which is a chunk of shared memory with all kinds of information about Servers
    and Clients. A Native Client, since it is running on the same machine that the
    Bulletin Board exists on, can directly access the shared memory. However, /WS client
    (also called a remote client) cannot access this shared memory. Instead, we have the
    WSL server to make connections with, and then WSH processes that access the Bulletin
    Board on behalf of the remote client.
    So Native Clients run on the same machine as the Servers and where the Bulletin Board
    is located, and have direct access to shared memory and other IPCs. Workstation
    Clients/WS Client/Remote Clients (all the same thing) cannot access IPCs and have the
    WSH do it on their behalf.
    In NT, the Tuxedo IPC Service mimics Unix IPCs, and so all the above is still true.
    Brian Douglass
    Transaction Processing Solutions, Inc.
    8555 W. Sahara
    Suite 112
    Las Vegas, NV 89117
    Voice: 702-254-5485
    Fax: 702-254-9449
    e-mail: [email protected]
    [briand.vcf]

  • What is difference between 32 bit and 64 bit sql server memory management

    What is difference between 32 bit and 64 bit sql server memory management
    Thanks
    Shashikala

    This is the basic difference...check if helps:
    A 32-bit CPU running 32-bit software (also known as the x86 platform) is so named because it is based on an architecture that can manipulate values that are up to 32 bits in length. This means that a 32-bit memory pointer can store a value between 0 and
    4,294,967,295 to reference a memory address. This equates to a maximum addressable space of 4GB on 32-bit platforms
    On the other hand 64-bit limit of 18,446,744,073,709,551,616, this number is so large that in memory/storage terminology it equates to 16 exabytes. You don’t come across that term very often, so to help understand the scale, here is the value converted to
    more commonly used measurements: 16 exabytes = 16,777,216 petabytes (16 million PB)➤ 17,179,869,184 terabytes (17 billion TB)➤ 17,592,186,044,416 gigabytes (17 trillion GB)➤
    As you can see, it is significantly larger than the 4GB virtual address space usable in 32-bit systems; it’s so large in fact that any hardware capable of using it all is sadly restricted to the realm of science fiction. Because of this, processor manufacturers
    decided to only implement a 44-bit address bus, which provides a virtual address space on 64-bit systems of 16TB. This was regarded as being more than enough address space for the foreseeable future and logically it’s split into an 8TB range for user mode
    and 8TB for kernel mode. Each 64-bit process running on an x64 platform will be able to address up to 8TB of VAS.
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • Inconsistent date formats between Rich Client and HTML client

    Hey All,
    Just wondering if anyone has come across an issue with inconsistent date formats from a universe based on an MS SSAS 2012 database connection in 4.x?
    The value of the date is returned as a string from the query but the object data type has been changed to a Date object meaning BusinessObjects should convert the string into a date if the format is correct.
    The problem in this is that the date being returned in Rich Client is in dd/MM/yyyy format whereas on the Web Client is in MM/dd/yyyy.
    From the Web Client business objects will return a date, however, it is a mix of MDY and DMY format.
    i.e. 15th of March will be displayed as 15/03/2014
    whereas 12th of March will be displayed as 03/12/2014
    All our application servers are configured for English (Australian) regional settings meaning all dates should be in DMY format.
    The date in the database is stored as a non-ambiguous yyyy-mm-dd format so it appears the variation is occurring somewhere between the database and BusinessObjects for the Web Client based reports only.
    I have also checked the sqlsrv.prm file based format and changed this to DMY but this has also not made a difference.
    The same universe in 3.1 and MS SSAS 2008 works correctly but not this one.

    Hi
    The date in the database is stored as yyyy-mm-dd format.
    As per user request.... Set the date format @ the Business layer level. so it will refelct same as in the WebI.
    Please find the below link. how to use custom Display option.
    BI4.1 Business Layer Enhancements - Create Display Format

  • "Face Time" app for Video Chat between iPhone 3GS and PC?

    Does anyone know of an iPhone app and/or PC application combo (besides Yahoo Messenger) that will support video chat between an iPhone 3GS and a PC (not a Mac)?
    FYI, I can already do video chat without Face Time between my iPhone 3GS and an iPhone 4, over WiFi or cell, using Fring and a reverse angle mirror from ISeeU.
    Thanks.

    Welcome to Discussions, TheWhiteMonkey
    TheWhiteMonkey wrote:
    Hello, how do you set up fring and your iPhone 3GS to use facetime?
    fring cannot "use" FaceTime. Only other FaceTime users can work with FaceTime.
    See http://support.apple.com/kb/HT4319 for info about FaceTime on iPhone. (3GS will not work.)
    See http://www.fring.com/default.php for info about what fring does.
    See http://itunes.apple.com/app/fring/id290948830?mt=8 for info on fring on iPhone.
    Mac Pro Quad Core (Early 2009) 2.93Ghz Mac OS X (10.6.5); MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.5)
    LED Cinema Display; G4 PowerBook 1.67GHz (10.4.11); iBookSE 366MHz (10.3.9); External iSight; iPod4touch4.2.1

  • Communication between J2ME MIDlet and J2SE server

    In my project I need to be able to exchange SMS messages between a J2ME MIDlet and a J2SE server? Is that possible? I tried the following:
    I included the CLDC, MIDP and WMA libraries in the classpath of my J2SE server and tried to use the wireless messaging API in the J2SE server. I get the following error message while trying to establish a MessageConnection:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.midp.Configuration.getProperty0(Ljava/lang/String;)Ljava/lang/String;
         at com.sun.midp.Configuration.getProperty0(Native Method)
         at com.sun.midp.Configuration.getProperty(Configuration.java:34)
         at com.sun.midp.io.InternalConnector.<clinit>(InternalConnector.java:91)
         at javax.microedition.io.Connector.open(Connector.java:158)
         at javax.microedition.io.Connector.open(Connector.java:138)
         at javax.microedition.io.Connector.open(Connector.java:120)
    Can anybody provide any suggestions?

    The communication should be done through these ports: https://social.technet.microsoft.com/Forums/windowsserver/en-US/6de9c3f0-2841-4a74-80bb-46a02779124b/which-tcp-ports-does-a-workstation-use-to-authenticate-to-ad-and-get-group-policy?forum=winserverNIS
    To have better visibility, you can setup a network sniffer like Wireshark and observe the traffic.
    As the ADFS and DCs will be located in the same LAN then it should be okay as no filtering should be done (Unless if this is done on local firewalls of the servers).
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • What is the difference between 'command delete' and using 'delete original and all versions'?

    My masters are not referenced and I usually have only one version.  What is the difference between using 'command delete' versus going to the top menu bar and using 'dele

    Good question  .
    When the Version is the only Version based on the Original of that Version, the two commands have the same effect.
    See this User Tip by master Aperturist Frank Caggiano.

  • Trying to understand text encodings between windows clients and oracle DB

    I am focusing on a "maybe bad configured" oracle windows xp client connecting into a well configured oracle db server (10g for example). Instead of just keep the correct client settings to make it work I would prefer to understand what is really doing the oracle client with all the posible bad configurations regarding encodings.
    When the client executes something like "SELECT 'Col1', N'Col2' from dual" before sending the sql sentence into the server the sentence itself should be encoded.
    But the way the sentence is encoded or the fact that some magic encoding transform occurs depends on the technology used (Java Thin, OCI, Oledb, etc..) and sometimes it depends on the windows setting "Languages for Non-unicode programs" and sometimes it depends on the client NLS_LANG setting on the registry. Or maybe thigs are simpler and I simply got confused... Here we could add that maybe some third party tool could do some other "helpfull" hidden magic encoding transformation to make it work and things become interesting
    A second time when all this encoding stuff should be considered is when the results of the sentences are retrieved on the client.
    At this point the client receives an byte stream from the server (that could be a VARCHAR column or a NVARCHAR column). Again depending on the technology used the client could be specting a utext, text (OCI) or a CHAR, NCHAR (in JAVA) or a SQL_C_WCHAR, SQL_C_CHAR (in OleDb), etc...
    Well, I'm not sure at all about the first point. Is all the sentence encoded in the same way before sending it to the server (ie is sended as plain text) or before the client parses the sentence and it understand that is sending a SELECT statement that returns two cols (one varchar and the other nvarchar)? For example the N, the ' and the Col2 are sent using the same encoding?

    Todd:
    Ref:
    http://docs.oracle.com/cd/E35855_01/tuxedo/docs12c/ads/adecid.html#wp1075436
    Section: Generating ECID by Native/WS/Jolt clients and Domain Gateway
    We are using Jolt Clients, via JSL for executing Tuxedo Services. The problem, we always face while debugging is cross relation. It would be extremely useful for us if we could get the ECID printed in webserver and tuxedo server process. Can we get ECID using any programming API in jolt client and in Tuxedo server process ? It would help us to correlate web, Tux and server logs
    Thanks,
    Biju

Maybe you are looking for

  • Home Directory Permissions on New Files/Folders

    Problem: When a user creates a file or folder in the root of their home folder (ie. not in their Documents or other default folder) it is given "read" access to the "others" POSIX permission. So, anyone browsing the "users" folder on the network can

  • 10.6.7, the 2011 MBP, and the death of easy cloning....

    I'm a photographer and whenever I've hit the road in the past, I'd clone my MacPro boot drive to an external, then boot my MacBookPro from the external, clone the external to the internal on the MBP and I'd be off, with an exact replica of my desktop

  • What is a good book about Lightroom

    Hi ... I am new to Lightroom, and am looking for a good book that covers the program's operation and use.  I'd appreciate any recommendations y'all might have.  Thanks! /kim PS: Sorry if this is an FAQ, but the search function isn't working, and I di

  • "License Activation" flow in CRM or ECC/Sales Distribution

    Hi , We sell some Software and Licence , when a customer wants to have more licenses for more users we yet need the customer to download a "key" from a given web site. And that is done . But for a Revenue Recognition and Licence tracking via Serial N

  • HT1551 My Apple TV (3rd gen) is a complete POS.  Is this a lemon, or is this product actually this awful?

    It regularly spontaneously disconnects from the wifi, and plays video with no sound, despite all settings being correct on all devices.  If one device on my network so much as gets a message through facebook, whatever device is hooked up to the apple