How to find out if SOCKET has CONNECTION on other END?

Hi Guys
Need some help. I have written a small client server app.
The CLIENT connects a SOCKET to the SERVER, after which can communicate.
If the SERVER terminates, and after the CLIENT trys to perform an action, is there anyway to find out before the CLIENT performs the action to see if there is a SERVER connection on the other end?
On the CLIENT side, I have used null which wont work as it previously had a connection. And i have already tried isConnected().
I dont know what im doing wrong, can someone please help?
Thanks in advanced!

isConnected() means, has ever connected.
The only way to check the server is still there is to read from the socket.
A simple way to do this is to send a byte/message which the server sees as a heartbeat message. The server can reply to the client and then you know the server is responding.
Other approaches are simpler or faster but involve some guess work.
Why don't you just send the data, but timeout the connection if the server is not there.

Similar Messages

  • How to find out which user has the permission to execute startsap ?

    Hi All
    How do I find out which user has the permission to execute the startsap and stopsap? Do I control the permission on those script using windows standard authorization? For example: only allow certain user have the read and write permission?
    Thank you.!
    Vincent Lo

    Well to me this is really weird question..
    <b>noone un-authorized should have access to OS on your system</b>
    If this is valid you do not need to solve problems who can and who cannot start/stop SAP, because if you want to prevent some users from shutting down the SAP you have really hard job to do - there are many ways how to kill the SAP (for example killing relevant process from task manager, killing of database, messing with services etc.) - yes, this is harmful way of stopping SAP, but we are talking about attack, right? I would contact some Windows specialist to help you disable all the ways how to harm the running SAP. But still after that - there are many files that can be modified/deleted so SAP will crash after restart - you need to protect them too, etc.
    In case you take the first assumption as granted (and you really limit access to this server) you do not need to worry who can stop or start SAP - at the other hand it may be handy to be able to start/stop SAP from other users - for this you can run the stop/start script "under different user".
    But to answer the question - to me this is question just of access control (but really never tried that myself):
    <a href="http://technet2.microsoft.com/WindowsServer/en/library/c6413717-511e-42bd-bd81-82431afe4b2a1033.mspx">Permit or restrict access to a snap-in for a domain</a> (or see other related links down there on this page)
    Please award points for useful answers.
    Thanks

  • How to find out which jobs are connected to the user

    Hello, i have a question, but i was unable to find the answer. The problem is that our internal consultant left the company, and there are certain jobs that run under his account. We want now to switch this jobs to other accounts. The problem we are facing is how to find out what jobs, or job steps are connected with his account, so we can safely demote his account, so that no other jobs will be run under his account. Thank you very much
    Sincerely,
    Luka Prijic

    the only reliable way to do this is by scanning table TBTCP using the person's userID in field AUTHCKNAM and filtering by job statuses: scheduled, released, ready and active (sorry I can't remember the code#'s off top of my head, something like P=scheduled, S=scheduled...you have to look it up).   When you search SM37 it only permits you to scan by the userID who created the job, but it won't tell you if a different userID is defined in a job step.  That's why you need to scan TBTCP.  Don't forget that you should also check for a user's open Workflow items before deletion.
    I noticed some posts in this forum that suggest a userID should never be deleted, only locked, added to a special user group, and all role assignments removed.  However I've never worked somewhere that does this.

  • ADF: How to find out which query has taken what time?

    Hi,
    I have an ADF application which has many SQL queried running on each button click/page load, so how to find out which query is taking what amount of time? So that i can identify the long running queries and modify them to improve the application performance.
    Thanks in advance.

    Hi,
    As suggested by Timo,you need to start tracing on oracle.jbo package for getting the SQL queries.But I think the second option suggested by him would be better.You will have to override executeQueryForCollection method in VO Impl class .Pseudo code would be
    @Override
    Take start time
    super.executeQueryForCollection
    Take end time

  • "Tag for status change alerts" - how to find out if someone has tagged you

    Dear all,
    On the "Tag for status change alerts" functionality, I was wondering if there is a way to find out if someone has tagged you for change alerts. Please let me know if I can find this out directly or by using an available tool / plugin. I am an user
    and do not have access to the lync server.
    Thanks in advance

    Doulouz is right. It is not possible to check that.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to find out if someone has accessed my iclouds

    how can i find out if some one other than (me)  the owner and only authorized person has accessed my icouds account with out my authority.  is there maybe a link that notes the time and date and maybe which device, hadd accessed the account?  if theres not one then apples needs to seriously get on top of this cause i see that its not just me thats having this isue i think that a link as such wouls solve and ease so much stress and nervouseness from people,
    thanks

    I know what a screenshot is
    So why mention it in connection with accessing your phone remotely then?
    I've been using mac computers for over 30yrs.
    So? You're asking about remotely accessing your phone, aren't you?
    I know what I saw, it looked like a 'terminal view' of remote access activity
    Well, you obviously don't know what you saw, otherwise you'd be able to find it again.. but considering iOS does not contain such a view of activity, and never has, it's hardly surprising you can't find it.
    The only place where anything is logged in iOS is in Settings > General > About > Diagnostics & Usage  > Diagnostics & Usage Data - but those are not remote access logs.
    By the way, your comments are very rude and condescending.
    LOL. Hardly - I've given you facts of the situation. Nobody can access your phone remotely, and no list of remote activity exists in iOS. If you can't accept facts then you've come to the wrong place.
    But believe what you want. Doesn't bother me. I've given up trying to help you.

  • How to find out status of JMS Connection ( connected or closed )

    Is there a way to find out the status ( connected or closed ) of JMS Connection at any point of time . JMS Connection interface doesn't seem to have any isAlive( ) sort of method ?
    I'm using a shared instance JMS Connection and if someone calls connection.close() on this instance the code starts flunking.

    Crap isn't it! Would also be useful for creating a JMS connection pool, or for testing connections that stay open for time time and may be closed by network problems etc.
    I can think of a couple of options (haven't tested them so may be flawed)
    1. Extend your vendors QueueConnectionFactory object to return a decorated Connection, which adds an isAlive() method and records internally whether someone has called .close(); This could be tricky if you use JNDI to retrieve the QCF - you'll have to bind your custom QCF and remove the old one. Much easier if you use a bean factory like Spring.
    2. You may be able to do this with the underlying vendor's API. If you choose this option put all the vendor specific code in a separate class and abstract it behind an interface. In future if you change to a JMS provider that does not support this feature, you can always change your isAlive() method return true no matter what;
    3. Wrap the JMS sender / receiver in an Adapter class. The adapter delegates send / receive methods to the wrapped class, but if it receives a JMS exception will reconnect and try again. A second JMS Exceptions should be thrown back to the client. All your client code sees is a single send / receive method as if it was using a normal JMS sender / receiver.

  • How to find out if GR has been done

    Hi,
    We are iplementing SRM 4.0, extended classic scenario.
    We have a requirement of sending out mails(reminders) to users to perform goods receipt (confirmations). My question is if I have the PO number and the item GUID for that PO, how can I find out whether Goods Receipt has been done for that particular line item of the PO. Is there any function module which will help?
    Thanks and Regards,
    Jayesh

    Hi Jayesh,
    As a starting point, you could use FM BBP_PD_PO_GETDETAIL and BBP_PD_CONF_GETDETAIL.
    All data are stored in tables displayed in transaction bbp_pd.
    Kind regards,
    Yann

  • How to find out resultset,statements and connections are not closed

    Hello,
    In Jdeveloper 10.1.2 how can I find out that in my code,
    I have resultset,statements and connections are not being closed.
    Any help is highly appreciable.
    Thanks

    Hello Vijay,
    On MSSQL truncation of transaction log does not shrink the size of the transaction log. It simply removes the content within the transaction log and writes it to the backup.
    Meaning the free percentage within the transaction log will increase.
    If you want to Resize the transaction log size, you need to do something else.
    The shrinking procedure is given here:
    http://support.microsoft.com/kb/907511
    Regards,
    Siddhesh

  • How to find out which object has a specific attribute value

    Hi all,
    which is the easiest way to check in a collection of objects which object has an attribute with a specific value?
    i.e. I have n objects of classA and they all have an attribute "String value;".
    How can I check which object has that attribute set to "myvalue"?
    Thanks,
    A.

    hi,
    i don't know if this would be the best way to do it, but i would add all the instances of the objects to a hashtable with the key as the attribute with which you want to search them. You would then retrieve the object using the value.
    Cath

  • How to find out which vendor has PO text

    I would like to pull out info about vendors and need to know which vendor has PO text, without of course having to check them one by one.
    is there any way i can see that? tables? text id??
    thanks
    Alisa

    Go to SE75 and Select EKKO or EKPO
    and Double click the EKKO or EKPO and Note the Text id..
    Then go to SE16 > STXH and enter Text ID..
    then execute , you will see the PO numbers for which the text id is maintained in 'Text Name' Column
    From EKKO table you can find the Vendor for the above PO's.

  • One time discount - how to find out if customer has aleady been given discount before?

    Client has requirement - they give first-time customers a certain discount, occasionally they give old customers the same discount (they want to be able to decide during the sales order entry).  They will enter manually with no condition records.
    They could use HA00 header discount type.. but how can they know whether that customer has received the same discount before?  Is there a standard sales report that can be run based on header conditions type?  We don't have time for custom development and would like find a standard solution.
    Is there a standard report based on order reason? Perhaps they can enter order reason for orders that have that one-time customer and can quickly run that report.
    Thanks!!

    Have you tried entering 'one time discount site:sap.com' in Google? This post is on the first result page, there are many others.
    Kindly refer to ROE and search before posting.
    @Siva - CDHDR table? Sorry, I'm confused... How exactly would it be helpful to OP?

  • How to find out which GR has been invoiced?

    Hello,
    I am working on one scenario in which I am making a sales order through which automatic Purchase order is getting generated. I am doing a MIGO(GR) for lesser quantity on this PO. lets say I am creating 4 GRs of 10 quantity for a PO of 50. Now, I am making direct invoice for this through VF01 with reference to sales order. An invoice of 40 will be created.
    Now, I am doing creating one more GR of 10 for the rest of the amount. I have 5 GR's now.
    How can I get to know which GR has been invoiced (table relation) and which is yet to be invoiced?

    Amrish,
    RSEG is the "Document Item: Incoming Invoice" table. In this table, Look for the field LFBNR , LFGJA, LFPOS.
    LFBNR - Refernced GR Number
    LFGJA - Year
    LFPOS - Ref Doc Item
    Hope this helps
    Vinodh Balakrishnan

  • How to find out that sequence has finished loading?

    Hello,
    i have a custom C#-OPUI to load and execute testplans.
    I do this using these funtions:
    1. ApplicationManager.OpenSequencFile(filename)
    2. ???
    3.Command TestStart = axSequenceFileViewMgr.GetCommand(.......)
    TestStart.Execute(true)
    The question is now: How do i know that the OpenSequenceFile has finished doing everything?
    I need to know that is finished before i run the execute-command.
    Is there a specail final-event that i can check?
    Thanks for help
    Solved!
    Go to Solution.

    Hi jigg,
    Thanks for the info.
    In my sequence file, besides the main sequence, I also enabled "SequenceFileLoad" callback. In "SequenceFileLoad" sequence, I added some instruments initialization tests. The goal is to initialize the instruments only once when the sequence file is loaded. Therefore I need to know when the "SequenceFileLoad" is finished or when the sequence file has finished loading.
    My first idea is to use the event "axApplicationMgr_SequenceFileOpened", but I found that I will catch this event before the "SequenceFileLoad" execution finished.
    And then, I also found that together with the execution of sequence "SequenceFileLoad", there are 2 events in my C# code: "axApplicationMgr_StartExecution" and "axApplicationMgr_EndExecution" triggered. So I was thinking may be I can use "axApplicationMgr_EndExecution" to determine if the sequence file has finished loading. But the problem is every sequence execution will trigger these 2 events. The main sequence will also trigger these 2 events. So I needs to know the name/ID of the current executing sequence.
    So Is there a way to read current executing sequence name?
    Thanks and regards,
    0049

  • How to find out what brush has been applied to a path...

    Reading the scripting documentation I didn't find the way to access the information about a possible brush applied to a pathItem. Is there a way to get the information using JavaScript - surely it has been store somewhere? I'd like to access the information because I need to apply the original brush to a new path the script generates. Cheers!
    I don't feel like cracking open the SDK just yet. ;)
    Best regards,
    Antti Myöhänen

    Hi Jayesh,
    As a starting point, you could use FM BBP_PD_PO_GETDETAIL and BBP_PD_CONF_GETDETAIL.
    All data are stored in tables displayed in transaction bbp_pd.
    Kind regards,
    Yann

Maybe you are looking for

  • How do I filter photos using the keyword hierarchy?

    Since Aperture 3.1 came out, I've been taking another look at it and considering switching back from Lightroom. One baby step was to set up a proper keyword hierarchy with Aperture. Trying to use that for sorting photos, I started feeling incredibly

  • Restore iPhoto after hard drive has been wiped?

    My Macbook Pro Hard Drive recently failed and the Apple store wiped it clean. I had a number of important photos on iPhoto and I am wondering if there is any way to retrieve these? Being that they were added recently to my computer via my iPhone (the

  • Quicktime Stopped Working...

    every time i open up quicktime it instantly says "Quicktime has stopped working. Windows is searching for a solution to this problem." when it never finds a solution. I need quicktime for iTunes, and i want to buy a new ipod but can't unless i know i

  • Exporting to DVD for Encore

    Hi all, I have been doing a lot of reading and have been trying to resist making a new topic, but I think I can't help it anymore, so here it goes. I previously got a crash course in exporting from within Premiere to Encore here - http://forums.adobe

  • Where is the Facebook integration?

    Looked through whole system and not one thing about facebook integration or anything which is one of the main reasons i bought this app its just not there and it should because thats how it was advertised.