Sockets & Good Practice

I have not done much network programming, but I've started writing my first client/server app. I have a client and server that exchange info. The way I've written it, the client opens a seperate socket everytime it sends or need to receive info. It seems like it would be easier in a lot of ways to just open a socket and keep it open for the life of the client. This way I could "push" info to a logged in client. Will the socket timeout if not used? How much more overhead would this be on the server?

the client opens a seperate socket everytime it sends or need to receive infoSo weird that I do not have words to utter on that ...
Just stop it, please.

Similar Messages

  • Is VHDX for data drive considered good practice on a client PC?

    Hi!
    I don't like putting user's data files (documents, etc.) inside the user's Documents directory on C:. Instead I prefer having them on a D: disk, separate from the OS. On the other hand I don't want to create a fixed size partition as I consider it a waste
    of space, especially when everything is on a rather small SSD.
    Therefore, I consider creating a virtual hard disk (VHDX) on my C: drive and making it dynamically expanding. This would allow me to store data on that "separate" disk which is actually an expanding VHDX file on C:. One problem is that for some
    unknown reason Windows 8.1 is not able to auto-attach such disks on startup, but I have seen some workarounds to auto-mount them through tasks.
    My question is the following: Is it considered good practice to put all data files on such a dynamic VHDX instead on a separate partition? Reading the VHDX explanations it looks like this file format is very stable (even in case of power loss) and is widely
    used in virtual servers. Performance should be also very good. Therefore I don't see any reason to not use it for my data drive. Or are there any drawbacks?
    Thanks in advance for any help.
    Best regards,
    Anguel

    Hi,
    Since the VHDX is created on C which should be the system partition, I don’t think it is more safety than separate partition.
    Please consider that once the system corrupted and we have to format the C to reinstall the System, it may be difficult for us to recovery the date. But the separated partition will be easily stayed without changes.
    You can try to shrink the C volume in Disk management to create a new partition.
    Just my thought.  
    Kate Li
    TechNet Community Support

  • What is a good practice to handle LOV in jdev apps?

    Hi, experts,
    In jdev 11.1.2.3,
    In our projects, there are many LOVs which the value are stored in a common dictionary table, for example in table refcode:
    refcode(id, low_value,high_value,meaning,domain_no),
    Different LOVs will retrieve value pairs(low_value,meaning) , or (high_value,meaning) from refcode table by using domain_no as the filtering criteria.
    In the end user's UI, the code/number field values should be displayed by a meaning word from refcode,
    To accomplish this goal, I will create numberous associations between different tables with refcode,
    and create VOs to have refcode entity view as a secondary entity view.
    I feel some odd in doing so(because so many associations with the same refcode table),
    Is that a good practice to handle LOV this way ?
    Thanks.

    On Fusion Developer's Guide for Oracle Application Development Framework
    10.3 Defining a Base View Object for Use with Lookup Tables
    (http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bclookups.htm#BABIBHIJ)
    10.3.3 How to Define the WHERE Clause of the Lookup View Object Using View Criteria
    There are valuable information and suggestions on implement lookup features, especially by using view criteria
    (the View Criteria and View accessor is one of important and great idea in ADF)
    I think, by using of view criteria, the derivative attribute to display fk information can be implemented in a convinent way without FK associations definition.

  • JTable: RFC on good practice (SQL queries from cell editor)

    I usually add/remove/edit JTable data from an external panel. But in this scenario, my client would like to be able to click on the first column of an empty row and enter a product number. Within the cell editor, I must make an SQL query to the database in order to determine if the product number is valid and if so, use part of the SQL data to populate other cells of the current row (like product description).
    My problem is that this just doesn't seem right! Isn't the cell editor executed on the only Swing thread? Also, if the product number is not valid, I correctly implement the stopCellEditing() method but for some reason, you can still navigate the table (click on any other cell or press the TAB key, etc)... weird!!
    Does anyone have a good practice on how to perform the SQL query in a better place and force a cell to be selected until you enter a valid number or press the CANCEL key?
    I was looking at implementing the TableModelListener's tableChanged(...) method but I'm not sure if that would be a better place either.
    I personally would edit outside of the table, but good practice seems hard when the requirement is to edit from a cell editor!!
    Any suggestion would be greatly appreciated!
    Thanks!

    maybe you could write an input verifier for the column that does the query and rejects invalid entries.
    maybe you could send the query off in a worker thread.
    as far as making the table so you can't select any cells, hmm. not sure.
    you could disable
    .setEnabled(false);the table until the query comes back, something like that.

  • Is that a good practice to use syncronize methods for application scope cls

    Is that a good practice to use synchronize method in a application scope class, so I have a doubt, there a is class A, it has application scope and it contains a synchronized method add, so because of some network traffic or any unexpected exception client1 got stuck in the method, will that add method available for any other client...?
    Edited by: navaneeth.j on Dec 17, 2009 4:02 AM
    Edited by: navaneeth.j on Dec 17, 2009 4:04 AM

    If it needs synchronization, then it probably doesn't belong in the application scope. Either keep it as is, or reconsider the scope, or make it static.

  • Overloaded methods-yes or no & is this a good practice

    say i have two methods with the same name that take in the same parameters and have the same return type. the difference between the two is that one is static while the other is not. Also the methods contain different codes.
    are the methods going to function normally when i use em? also if they do function normally, is this essentially a good practice?
    if code is needed to answer this, please do mention it and i will think of a mini scenario where this can be applied and write a small piece of code for that.
    thanx. help will be appreciated.

    avi.cool wrote:
    duffymo wrote:
    each account has its own password that the user sets when the account is created-this password is declared as a state variable in the class file. One password per account? A bad model, IMO. My on-line banking software associates credentials with me, not my accounts. I see several accounts when I log in, and I don't have to log in individually for each one.
    besides that, theres also a bank password-this is declared and initialized as a static state variable in the class file. some of the operations require the bank password for access while others require account password.Static bank password? I'm very glad this is a throw-away student exercise, because you have no idea what you're doing.hahaaa, tru tru, its for a skool assignment for my first ever programming course. though not a throw away, i putting a lot of work into this :-) i m not actually trying to resolve any security issues here or strengthen account security. basically, I am only trying to exhibit a tiny bit of creativity while showing understanding of course contents. so nothing to stress on :-D i know not very creative but its all i got at this stage.
    i was trying to exhibit the use of overloaded methods in my program by having method to check the password that the user enters to access operations.
    now the ones that require account password, i was thinking of having the password check method as a non-static method since its associated with the object.
    while the ones that need bank password, i wanted to have as static method.
    i wanted both methods to have the same name.You've no idea what you're doing.
    how i solved it,
    i decided on having both methods as static methods. the one that checks account password, takes in two parameters, the account name(object name) and the string to be checkd. the one that checks bank password, takes in only one parameter- the string to be checked.Wrong.i would be really thankful if you could help me rectify my mistake and advice on how i should be doing this. is there a conceptual error? i am a bit confused now.
    Its exactly what I told you.. but now, you just have to come on here and post this :p
    and isn't this sort of like cheating? :P I mean this IS our exam you know... You're basically asking other for the arithmetic and logic lol.

  • What is good practice for playing multiple video's in a single swf?

    Hello,
    I have build in the past a video wall with video's inside. After building this i came across some problems.
    If you have too many video players loading at once it takes a lot of processing and the tweens in the
    page while loading the video's where not moving fluidly, but more in a stuttering way.
    After lot's of test i found a good working solution.  I imported the flv video's into flash en exported them on the timeline
    as a embedded swf.  Then i externally loaded these swf files and that performed much better.
    Is it even good practice to load multiple video instances at once? I used this time the LoaderMax of greensock but the video's
    only play after it's completely loaded. I would like to find a way to progressive play all video's at.
    Does someone has experience with this?
    Regards,
    Chris.

    How about an XML file which supplies the title for each movie and the location or source of the video to be played?  Simple version below.
    <?xml version="1.0" ?>
    - <playlist>
    <video src="Gfx/video/Alex1.f4v" title="John Deere 330" />
    <video src="Gfx/video/Benni1.f4v" title="Hitachi Z240F" />
    <video src="Gfx/video/Scotti1.f4v" title="Hitachi Z350F" />
    <video src="Gfx/video/Scotti2.f4v" title="Hitachi Z350F" />
    </playlist>
    JR

  • Is it good practice to auto submit forms?

    My users use forms that involve lots of textual matter and sometimes when after working for hours typing into the forms they might move out to some other links there by not submitting the form.
    Is it a good practice to auto save the contents of the form if there has been no inactivity for 5 minutes?
    What are the pros and cons of this approach?
    One problem the above approach could throw is if the user actually types in some data and forgets to close the browser window, the forms keeps on getting submitting unintentionally. This is ok with the user.
    Other alternatives like prompting the user for saving at frequent intervals have been thought of.

    as long as you can determine there's been no activity (simple enough with onblur/onfocus and other events in the fields) and can save the contents in a way that is not a submission, then it's not a bad idea. I wouldn't save after X minutes while the user is doing some entry, cuz it may interrupt what they are doing. Or you could use hidden frames and JS to save things without affecting the user.

  • Good Practice for managing player high scores & other stats

    During PC based game development, what is a good practice for saving high scores, game history etc for multiple users in terms of the following attributes :
    file types, data types to be used in the file, file protection from manual editing etc.
    pls throw some advice on the popular industry practice in use.
    regards, bittu ch

    During PC based game development, what is a good practice for saving high scores, game history etc for multiple users in terms of the following attributes :
    file types, data types to be used in the file, file protection from manual editing etc.
    pls throw some advice on the popular industry practice in use.
    regards, bittu ch

  • Is it necessary to use this. on objects or is it just good practice?

    Is it necessary to use this. on objects or is it just good practice?

    warnerja wrote:
    yawmark wrote:
    Is it necessary to use this. on objects or is it just good practice?It's good practice to use it when it's necessary.
    ~No, it's only necessary to use it when it's necessary.
    It's good practice to use it when it's good practice.<****/>
    <****/>
    <****/>
    (the sound of one hand, clapping)

  • Good Practices and Code Conventions

    Hi All,
    What are the good practices in java? Are there coding convention to be followed?
    I would like to improve my coding standards and write better code. Please help me.
    Thanks
    Diana

    Diana12 wrote:
    Then how to make it excellent?Are you serious? Do you expect us to give you a 2-line summary of how to make "excellent" code?
    It takes some time to learn to write excellent code and it can't easily be summarized into 1-2 sentences. If it could, then it would be much easier to learn (that would be nice!).
    Experience, making mistakes, realizing they were mistakes, not making the same mistakes later on. Having your code criticized by someone who writes better code than you. That's how you learn to write excellent code.
    Write simple code, keep it clean, make each method do one thing, write code that doesn't need documentation, document where you must, adhere to the open-close principle, adhere to the KISS principle, adhere to the YAGNI principle, ...
    Grab [The Pragmatic Programmer|http://www.pragprog.com/the-pragmatic-programmer] and read it. Then read it again. Do some more exercises and read it a third time.

  • Is it the good practice?

    Hi,
    With OIM 11g, I try to implement different UI requests for user creation.
    A request for external users and a request for internal users.
    For both of them, UI displays only :
    -Last name
    -First name
    -Birth Date
    For external user request, email is generated by firstname an lastname and prefixed by external.
    For internal user request, email is generated by firstname an lastname and not prefixed.
    To do that, I would like to use the request API "Platform.getService(RequestService.class)" in an event handler to get the request template name and generate the mail according to the template name.
    Can I get the request id in the event handler?
    Is it the good practice?
    Regards,
    Pierre.

    user1214565 wrote:
    thank you very much bbagaria,
    Can I use different datasets for user creation, one for external user, one for internal (I thought I could only modify and use the default dataset: /metadata/iam-features-requestactions/model-data/CreateUserDataSet.xml for all creation request)?
    If yes, how? (I tried to import MyCreateInternalUserDataSet.xml but it didn't work)
    With the default dataset, I expected to create two request templates, one for internal and one for external and get the template name in the a preprocess event handler.
    Regards,
    PierrePierre,
    I would suggest that you just modify the CreateUserDataSet.xml (not rename but import it back at same location in MDS [over-write]) to add additional field for type of user (hidden if you want) and use prepopulate with the type of user internal or external based on the template selection. The prepopulate adapter takes in RequestData object and that has getRequestTemplateName() method. Or just populate the email based on the template selection.
    I haven't tried this but theoretically it seems that you can user this.
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e17334/oracle/iam/request/vo/RequestData.html#getRequestTemplateName__
    HTH,
    BB

  • Good practices for ECC 6.0 wr.t. internal tables..

    hi,
    i am told that when defining internal tables in ecc 6.0, we shud avoid using OCCURS and WITH HEADER LINE.  and always use work areas..
    is this right ? is this a good practice or a must ?
    i followed this and created an internal table without a header line .then i  am using a collect statement in my programn which fails and says that IT is not with header line !!
    COLLECT ITT.
    what to do ?
    thks

    Yes, that is correct.  SAP is pushing the use of ABAP Objects and you can not use OCCURS or HEADER LINEs in the ABAP OO context.  You should always defined explicitly and a work area.
    Data: itab type table of mara.
    Data: wa like line of itab.
    So then you must keep this in mind when doing any operations on internal tables, like in the case of the COLLECT statement, the syntax would be.
    wa-field1 = '1'.
    wa-field2 = '2'.
    Collect wa into itab.
    Regards,
    Rich Heilman

  • GOA - Good practice in your projects

    Hi All
    Are you changing the following things in your GOA ?
    1.Target value of contract - Intially you create a contract for 10,000 INR and later can you change the same contract to 99,9999 INR? i think it is allowed is srm
    2.Can you change the Contract validity date ? iniatiially you create a contarct validity date is 2009.09.01 and later can you extend the contract validity date to 2010.12.12 ?
    Ability to extend the contract ?
    Abiility to change the target value data ?
    Are you do maintance of contract ?
    What piece of data buyr many change after creaing original goa ? for eg. set inactive material . what piece of data buyer may change in your account?
    Are these standard SRM allows?
    br
    muthu

    It depends on how the client/company wants to use this option. If we assume that there are no other measures to assure the validity of the contract terms then it is not a good practice.
    The option to change is there because it is possible some buyers negotiate or renegotiate contract terms offline and not through an RFQ. We cannot assume that the contract terms, once negotiated, will be constant and that negotiations always happen through SRM - need not be an RFQ (not in all companies).
    Ofcourse this puts the responsibility on the buyer to make sure everything is correct and as agreed with the vendor. It provides the flexibility. In the end, the buyer is responsible for maintaining the contract anyway.

  • Regarding good practice

    Hi,
    Can somebody let me know whether it is a good practice to have two declare section in same procedure in pl/sql programming. Is there any draw back for same?
    Regards,
    basil Abraham.

    user575682 wrote:
    Can somebody let me know whether it is a good practice to have two declare section in same procedure in pl/sql programming. Is there any draw back for same? It is good practice not to have declare sections at all - as PL/SQL code is best done inside the Oracle database as stored packages and procedure and functions. This does not require a declare section at all - unless when dealing with the exception of dynamic PL code. (an exception that requires very sound technical reasoning)
    For the external applications making PL/SQL calls using anonymous PL/SQL code blocks, these may use declare sections.. but usually not. Why?
    Declarations are typical for variables to be used in the anonymous block. As bind variables should be used by the application, there is very seldom the need to make use of a declare section.
    So the declare section is not something that you should often see and use in production PL/SQL code. Both in stored code in the database, and in anonymous block code in external applications.
    Mostly the declare section is found in code (anonymous PL/SQL blocks) used for purposes like testing. (e.g. typically adhoc code and not formal production code)

Maybe you are looking for

  • Webpages are not display correctly

    Hello, my problem is webpages are not shown correctly you can see in images i use chrome Version 41.0.2272.118 dev-m   it is shown correctly after certain refreshes please help me this is very irritating.

  • Changing server file name

    hi how can i change file name of file that found some directory in the server and i hvae the old name and the bath. to change the name of the file just only , not to change what the file contains on it. thanks, best regards Owesat ehsan

  • HT5675 i need java 1.6 to get ,m,inecraft but it wont ever work please help?

    i need java 1.6 to get minecraft but it wont ever work someone please help me!

  • Oracle RAC + Clusterware and another Cluster with Clusterware for SAP

    Hi, I have some questions about implementation of Oracle RAC and Clusterware with SAP For exemple, an architecture with 4 servers ( 2 real and 2 vritual ). I would like to know if i can do this 2 servers for the first cluster. First cluster is with C

  • Buy iPhoto book

    During the process of buying a iPhoto book, the system ask the delivery contact information, where it doesn't accept the phone number. So I can't finish the order process! Is there a solution for this problem. Already try to create a new Apple ID wit