The client socket all close them when we're closed

Hello
I'm developing of SMTP mail server for my school project and basically everthing was fine until I encountered this problem. Here is my code:


/ public class SMTPKonekcija implements Runnable {}
some variables

public SMTPKonekcija (socket) {}
This.Socket = socket;
}

public void run() {}
try {}

the flow inlet-outuput of Seting and some other stuff

even if (quitFlag == false) {}
Here I accept SMTP commands and generate and send responses
}
This.Socket.Close ();
some flag settings
} catch (Exception e) {}

}
}

And my main class looks like this:

public class MainKlasa {}
Public Shared Sub main (String [] args) {}
int port = 25;

try {}
ServerSocket mailSocket = new ServerSocket (port);

While (true) {}
SMTPsocket socket = mailSocket.accept ();

SMTPKonekcija konekcija = new SMTPKonekcija (mailSocket.accept ());

Nit thread = new Thread (konekcija);

nit. Start();
}
} catch (Exception e) {}
e.printStackTrace ();
}
}
}



When I run this server and you connect it via telnet at the same time my laptop and PC, it works just how it's supposed to. Both clients have their own sessions, server correctly becomes orders and give answers, so I think that part works well. But when a client ends it is session (for example, when you give the command "QUIT") and server accepts this command and closes this socket, another client socket is automatically closed too, and if I try to send a command after this point, I'm getting exception closed socket. I am yet to learn Java and this multi threading gives me headaches so, so any help would be greatly appreciated.

/ public class SMTPKonekcija implements Runnable {}
some variables

They are static? They should not be. More precisely the 'socket' and flow variables must be non-static.

Tags: Java

Similar Questions

  • I DELETED MY PDF FILES AND AGAIN USING THE RECOVERY SOFTWARE I FIND ALL MY FILES BUT NOW WHEN I OPEN FILES THAT IT SHOWS (THE FILE MAY BE CORRUPTED OR NOT SUPPORTED FORMAT.NO HOW CAN I OPEN THE FILES.) ALL OF THEM ARE MY DOCUMENTS IS VERY IMPORTANT. PLEAS

    I DELETED MY PDF FILES AND AGAIN USING THE RECOVERY SOFTWARE I FIND ALL MY FILES BUT NOW WHEN I OPEN FILES THAT IT SHOWS (THE FILE MAY BE CORRUPTED OR NOT SUPPORTED FORMAT.NO HOW CAN I OPEN THE FILES.) ALL OF THEM ARE MY DOCUMENTS IS VERY IMPORTANT. PLEASE PROVIDE ME WITH A

    Deleted file recovery can recover incomplete files, i.e. the part of these files may be missing.  Recover deleted files is much more reliable if recovery of a backup, instead of using recovery software.

    These things depend on the operating system and the file system.

    One thing, you can see: open one of these files damaged with a text editor, and then make sure that the constant % PDF is somewhere in the first 1024 bytes.

    PS please do not post ALL uppercase; It is very difficult to read!

  • The desktop icons all moving them to the left side of the desktop.

    The desktop icons all moving them to the left side of the screen to the start or restart. I use Windows Vista.

    Hello

    System Restore works if you have a point of return to until the icons have been changed if there is a lot to do
    just for the positioning of the icon. Right click on desktop - view and you probably have the reorganization and align it on the grid
    checked.

    How to make a Vista system restore
    http://www.Vistax64.com/tutorials/76905-System-Restore-how.html
    How to create a Vista System Restore Point
    http://www.Vistax64.com/tutorials/76332-system-restore-point-create.html
    ---------------------------------------------

    Difficulty for the desktop icons set in not getting saved after restarting Windows
    http://www.Winhelponline.com/blog/fix-desktop-icons-layout-not-saved-restart/

    ---------------------------------------------

    These Vista works, but they are a download.

    Save and restore the desktop icon layout in Windows NT/2000/XP/Vista
    http://www.Winhelponline.com/blog/save-and-restore-desktop-icon-layout/

    Save and restore the desktop icon Layout in Windows Vista - free
    http://www.howtogeek.com/HOWTO/Windows-Vista/save-and-restore-desktop-icon-layout-in-Windows-Vista/

    TIP : right click on desktop - DISPLAY - uncheck AutoArrange and snap to grid when you want to restore the icons
    or restoring won't work. You can re - check those as needed later and apply the Align attribute on the grid before the
    Auto arrange.

    -------------

    Office catering - free
    http://www.MIDIOX.com/

    Info
    http://www.MIDIOX.com/HTML/desktop.htm

    --------------------

    Lock the post Office icons and disable right click
    http://www.techmynd.com/lock-desktop-icons-position-and-disable-right-click/

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • Muse too big resolution. Can't see the widget panels all muse-themes

    Screen Shot 02-25-15 at 12.44 PM.PNG

    Muse too big resolution. Can't see the widget panels all muse-themes

    Hello

    Please check the following forum thread, can be useful:

    Update the 2014.3 muse has a UI that is oversized.

    Concerning

    Sonam

  • Why the sites I visit will not stay the way which I configure them when I use Firefox?

    For example: when I go on MSNBC I put the number of articles for different subjects and they go back by default every time I open firefox. This does not happen with IE. Another is that I have to log in to my hotmail and Gmail account every time that I re - enter in the browser. Help, please.

                                                                             Thanks, Nicholas
    

    Hello Nicolas, all these parameters and States of connection are usually stored in cookies. you have firefox set up to keep cookies between sessions and do not erase this kind of private data, once you close firefox? Additionally, make sure that you do not use an external security or the cleaning tool which may interfere with the management of cookies in firefox.

    Cookies - Information that Web sites store on your computer

  • Windows7 64 bit. Why the desktop icons all be empty when you run Firefox nightly for the first time?

    Every time after I get a Firefox Nightly update and run it, it will display the next page:
    https://www.mozilla.org/en-US/firefox/nightly/firstrun/?oldversion=30.0 which is fine.
    But when it opens this page, all my desktop icons go clear/white and one by one, they all return with their correct icons. And all this happens in a few seconds.
    Why is the operation of Firefox every night for the first time, my desktop icons?

    I suspect that you have both nightly and Firefox version installed?

    "The Firefox 'about' shows 30.0. and I've now checked for updates and are now running 33.1.1"
    

    It's different from what you have first published here with!
    Firefox 33.1.1 represents the latest version - a 32-bit version.

    Whereas, the version you first posted here with was a generation of 64-bit channel every night from July. Every night is for "Alpha-testers" and is updated every day, where the name of "night".

    Everything that happens in the background on the Windows desktop should not be of concern right now, every night Win 64 bit is several months out.
    If you really want to test the Win 64 Nightly builds, follow and participate in the very different evenings and son of 'channels' on MozillaZine forum is based.

  • In Muse, I can't use the tool of selection on the thumbnails without ALL distort them. "Change set" is not enabled and "thumbnails is Freeform. Very frustrating!

    I can't turn off the function "Edit together" in the control panel thumbnail widget. I can uncheck, but my thumb nails all continues to edit together. What is the cure?

    Hi Craig,.

    It is not possible to make the different dimensions of the thumbnails on a slideshow widget. Change all the works for thumbnails of formatting, do not to the re-sizing. You will need to use a widget of composition, if you need thumbnails of different sizes.

    Please check this related discussion here, How can I create a Lightbox with various sizes of tile. for example landscape, portrait etc?

    - Abhishek Maurya

  • Firefox displays a cursor blinking 'Edit' in the body of all Web sites when I click.

    By clicking a button on a page Web puts the text flashing in the body of the site, like cursor editing a Word document. It is not cause other problems in addition to being really annoying and distracting, but it started today. I tried to restart Firefox with disabled modules, as well as to reinstall clean Firefox.

    Besides the above:

    This is probably because passing on the keyboard navigation and you can switch power switch keyboard navigation by pressing F7 (Mac: fn + F7).

    Note that this is a function of Firefox Accessibility.

    • Tools > Options > advanced > general > accessibility: [] "always use the cursor keys to navigate through the pages."
  • WITH WIN XP, SECURITY LEAVE, ME SAYS TO REINSTALL THE CLIENT S ERROR CODE OX8007064C WHEN I TRY TO REINSTALL MS SECURITY ESSEN IT RUNS FOR HOURS BUT WILL NOT INSTALL

    I DELETED THE OLD PROGRAM AND RESTORED TO EARLIER IN THE DAY AND WITH NO LUCK, THANKS FOR ANY HELP.

    I DELETED THE OLD PROGRAM AND RESTORED TO EARLIER IN THE DAY AND WITH NO LUCK, THANKS FOR ANY HELP.

    (Please do not SCREAM!)

    http://support.Microsoft.com/kb/958055

    can help

  • Download 2 Adobe Creative Cloud Apps without the acquisition of all of them?

    I need to download Adobe Premiere Pro and Adobe After Effects.  I was wondering if I could download just those two apps without buying all applications.

    Yes, you can sign up for individual programs 2... $ 19.99 each

    Cloud Plans https://creative.adobe.com/plans

  • Help! flash player Adobe installs not, it keeps telling me to close safari when it is closed!

    IV tried several times, even tried to download adobe directly after turning on the computer and not by clicking on safari at all for hours... I don't know what to do! I need adobe to work. I have a mac 13 inches from the retina of display... the newer version. only had it for a week. any help please

    You must close the Safari, not only the window of the browser process.

  • Inspiron 1525 integrated webcam not detected when the laptop is open, but works when it is closed

    I see that the webcam works (blue light is on I can open less then to halfway and see the desktop and a part of the computer in photo. then open more than half and get error webcam not detected.)

    Help please

    Hello

    Check with Dell technical support, online documentation and drivers and their known forums
    problems and solutions.

    Dell support
    http://support.Dell.com/

    Dell support drivers - product manual & warranty Info (left side) - and much more
    http://support.Dell.com/support/index.aspx?c=us&l=en&s=DHS

    Dell forums
    http://en.community.Dell.com/forums/
    -------------------------

    Help generic camera:

    Double-click Control Panel / Device Manager - Imaging - writing down of the brand and model of camera.
    on this subject and on the tab of the driver is version. Now, click on update drivers (who are unable to do anything as MS
    is far behind the pilots of certification). RIGHT click on the camera - UNINSTALL - REBOOT - it
    will update the driver stack.

    Now, go to the system manufacturer's website and download the latest driver for the camera and the other related camera
    software (if not more recent get the same).

    Download - SAVE - go to them and RIGHT CLICK - RUN AS ADMIN - reboot after each driver.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    How to install a device driver in Vista Device Manager
    http://www.Vistax64.com/tutorials/193584-Device-Manager-install-driver.html

    Then let windows updates on however prevent loading of drivers who are often older than the
    those that you have installed. If updates suggests a pilot and then HIDE it and watch manually to see if their
    really is a more recent version (at the time system manufacturer and the sites of the manufacturer of the device).

    How to disable automatic driver Installation in Windows Vista - drivers
    http://www.AddictiveTips.com/Windows-Tips/how-to-disable-automatic-driver-installation-in-Windows-Vista/
    http://TechNet.Microsoft.com/en-us/library/cc730606 (WS.10) .aspx

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Changed in Windows Mail - is the same for all e-mails in the folder

    using version 6.0 of Windows Mail.

    all emails in a few files changed identical to the same text thought that the subject lines are correct. When I open each email text is the same in all of them.

    This is probably due to database corruption that often occurs if antivirus software is installed (see www.oehelp.com/OETips.aspx#3).  What you can do is to try compacting and repairing the database using my Windows Mail utility (www.oehelp.com/WMUtil/) and see if that fixes the problem.

    Steve

  • Integration of the clients

    Hi guys,.

    I build my lab at home and I was going through the objectives of the review, one by one, until I came to (models and Clones), and that's when my problem started. before you begin to tell you my problem, so I want to give any idea of how my lab at home is built. I build all on vmware workstation, and so I have: -.

    1 windows server 2008 for DC 2 GB

    2. windows server 2008 for all vcenter5.5 4 GB

    3. 2 esxi host5.5 2 GB each change it after

    4 openfiler

    5 virtual router

    maybe by now you've guessed I'm training video cbtnuggets.

    I use google chrome as my web browser on my local computer and I downloaded and installed the client plugin integration

    so when I try to deploy a model of the FVO in the esxi host, first he asks me the site uses vmware customer integration plugin as show in the picture. I click OK

    vmware plug-ins.png

    so I go through the steps until I reach the tab where it is requested to specify the storage. I select the storage and click Next.


    can it validate the process and then it shows me a message saying connection error has occurred because it is to show the image

    cannot connect to vcenter.png

    I searched on the problem, but cloudn can't well all help even if I tried to do everything I can to solve this problem, but nothing what I worked.

    I firmly believe that it is related to the integration of Client plug-ins. I want to continue my training video lab but I can't because of this error.

    is there a way you guys could help me?

    I'm really confused and concerned by this problem.

    From what I see on the image below, you are logged by IP address by using the Web Client vSphere... given that the DNS resolution works, try to connect by using the FULL domain name: https://srv.nuglab.com:9443 / vsphere client and deploy the OVF again.

  • Pop-up ads continue despite all the information here regarding remove them.  I think they were watching when I downloaded an update for Adobe Flash Player.  All of the suggestions!

    I use OS x El Capitan 10.11.2 on my 3.2 GHz, 8 GB Mac.  I keep getting the pop - ads that those scam ads reply and get their malicious software solution.  I also get the help line 'Apple' where someone's endearing supposedly walk me if they can help.  I tried all of the solutions in the Apple support groups, but nothing has worked... remove extensions (don't have), in order to put the files listed in 'Go to Folder' (none came, so I couldn't remove them).  Any ideas?  It seems that it got worse after I received a notice to update my Adobe Flash Player... maybe a false update.

    1. the present proceedings is a diagnostic test. It doesn't change anything for the better or worse and therefore, by itself, will not solve the problem. But with the help of the results of the tests, the solution may take a few minutes, instead of hours or days.

    The test works on OS X 10.7 ("Lion") and later versions. I do not recommend running it on older versions of Mac OS X. It will do no harm, but it will not do not much good.

    Do not be put off by the complexity of these instructions. The process is much less complicated than the description. You make the tasks more complicated with the computer all the time.

    2. If you do not already have a current backup, please back up all the data before doing anything else. The backup is needed on the general principle, not because of what anyone in the test procedure. Backup is always a must, and when you encounter any kind of problems with the computer, you can be more than the usual loss of data, if you follow these instructions or risk not.

    There are ways to back up a computer that is not fully functional. Ask if you need advice.

    3 here is instructions to run a UNIX shell script, a type of program. As I wrote above, it doesn't change anything. It does not send or receive data over the network. There is no to generate a report on the State of the computer human readable. This report goes nowhere unless you choose to share it. If you prefer, you can act on it yourself without disclosing the contents for me or someone else.

    You should ask yourself if you can believe me, and if it is safe to run a program at the request of a foreign national. In general, no, he's not sure, and I encourage it.

    In this case, however, there are ways for you to decide if the program is safe without having to trust me. First of all, you can read it. Unlike an application that download you and click to start, it is transparent, so any person with the required competence can check what it does.

    You may not be able to understand the script yourself. But variations of it have been posted on this site of thousands of times over a period of years. The site is hosted by Apple, which does not allow it to be used to distribute harmful software. One of the million registered users to have read the script and set off the alarm if it was dangerous. Then I wouldn't be here now, and you would not be reading this message. See, e.g., this discussion.

    Another indication that the test is safe in this threadand this onecan be found, for example, where the comment in which I suggested it was recommended by one of the specialists of the communityApple, as explained here.

    However, if you cannot satisfy yourself that these instructions are safe, do not follow them. Ask other solutions.

    4. here is a general summary of what you need to do, if you decide to go forward:

    ☞ Copy a particular line of text to the Clipboard.

    ☞ Paste into the window to another application.

    ☞ Wait for the test to run. It usually takes a few minutes.

    ☞ Stick the results, which will be copied automatically, in a response on this page.

    These are not specific instructions; just a glimpse. The details are in parts 7 and 8 of this comment. The sequence is: copy, paste, wait and paste it again. You don't need to copy a second time.

    5. try to test in conditions that replicate the problem, to the extent possible. For example, if the computer is slow intermittently, run the test during a downturn.

    You may have started up in safe mode. If the system is now in safe mode and works pretty well in normal mode to test run, restart as usual before running it. If you can test only in safe mode, this.

    6. If you have more than one user and a user is affected by the problem, and the user is not an administrator, and then run the test twice: once under the affected user and one administrator. The results can be different. The user that is created automatically on a new computer, when you start it for the first time is an administrator. If you are unable to log in as an administrator, verify that the user concerned. More personal Mac have only one user, and in this case this section does not apply. Don't log in as root.

    7 load the linked web page (the site "Pastebin.") The title of the page is 'Diagnostic Test'. Under the title is a text box, headed by three small icons. The right one represents a Clipboard. Click on this icon to select the text, then copy to the Clipboard of your computer by pressing Control-C key combination.

    If the text is not highlighted when you click the icon, select it in triple - click anywhere inside the box. Do not select the whole page, just the text in the box.

    8. start the Terminal application integrated in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    Click anywhere in the Terminal window to activate it. Paste from the Clipboard into the window by pressing Command + V, then press return. The text that you pasted should disappear immediately.

    9. If you see an error message in the Terminal as "Syntax error" or "Event not found", enter

    exec bash

    and press return. Then paste the script again.

    10. If you logged in as an administrator, you will be prompted for your login password. Nothing displayed when you type. You won't see the usual points instead of the characters typed. Make sure that caps lock is turned off. Type carefully, and then press return. You can get a warning to be careful. If you make three unsuccessful attempts to enter the password, the test is still running, but it will produce less information. If you do not know the password, or if you prefer not to enter, just press back three times at the password prompt. Yet once again, the script will run.

    If the test takes much longer that usual to run because the computer is very slow, you can be prompted for your password a second time. The permission you grant by entering it will expire automatically after five minutes.

    If you are not logged as an administrator, you will be prompted for a password. The test will run. It just will not do anything that requires administrator privileges.

    11. the test may take a few minutes to run, depending on the number of files you have and the speed of the computer. A computer that is abnormally slow may take more time to run the test. During execution, a series of lines is displayed in the Terminal window like this:

        Test started
            Part 1 of 4 done at: … sec        …        Part 4 of 4 done at: … sec
        The test results are on the Clipboard.
        Please close this window.

    The intervals between the parties will not be exactly the same, but they give an approximate indication of progress.

    Wait for the final message "Please close this window" appears. If you don't see it in about 15 minutes, the test probably won't be all within a reasonable time. In this case, press the Ctrl + C key combination or the point command to stop it. Then go to the next step. You will have incomplete results, but still something. If you close the window of the Terminal, while the test is still running, the partial results will not be saved and you have to start over.

    12. when the test is finished, or if you have stopped it because it was taking too long, leaving the Terminal. The results have been saved to the Clipboard automatically. They do not appear in the Terminal window. Please do not copy from there. All you have to do is start a response to this comment and then paste it again by pressing Command-V.

    At the top of the results, there will be a line that begins with the words «Start time.» If you do not see that, but rather to see a mass of gibberish, you wait for the message "close this window". Please wait and try again.

    If personal information, such as your name or e-mail address, appear in the results, make anonymous before posting. Usually it will be not necessary.

    13. in the validation of the results, you see an error message on the web page: "you have included content in your post that is not allowed", or "the message contains invalid characters." It's a bug in the software which manages this website. Thanks for posting the results of the tests on Pastebin, then post here a link to the page you created.

    If you have an account on Pastebin, please do not select private in exposure menu to paste on the page, because no one else that you will be able to see it.

    14. This is a public forum and others can give you advice based on the results of the test. They speak for themselves, not for me. The test itself is harmless, but what're told you to do maybe not. For others who choose to run it, I do not recommend that you view the results of test on this Web site unless I ask.

    ______________________________________________________________

    Copyright © 2014, 2015 by Linc Davis. As the sole author of this work (including the "Test of diagnosis" referenced), I reserve all rights except as provided in the terms of use agreement for the site of Apple support communities ("CSA"). ASC readers can copy for their personal use. The whole nor any part can be redistributed.

Maybe you are looking for

  • Cannot update iOS 9.2.1 on the air of the iPad 2

    Update iOS 9.2.1 for UN-athorised fix comes out. Working victory over 6s but fail after downloading and during treatment on Air2 iPad download using iTunes. Everything an els having this problem?

  • Equium M40X silver high marks too easily

    My new M40X has a silver coloured screen and cover top which marks if you look at all. He had a transparent plastic cover, but it is ugly and peeled off. It is stupid to do something so easily scratched when it is a portable device. Otherwise, it's a

  • Try to reinstall Windows XP after a virus but I have no disks.

    help a friend with his computer from hp, he has a virus and nothing is getting rid of him, try to reinstall operating system, but she has lost his drive, I have a dell drive but it will only install xp on dell computers, any advice on what I can do?

  • Help on drivers for HP Pavilion dv6-6160se Entertainment Notebook PC

    Hello I just formatted my laptop HP Pavilion dv6-6160se Entertainment Notebook PC yesterday and now I can't find many pilots like the simple collar and beats audio and bluetooth, so can someone help me and give me a link to download all the drivers f

  • How can I fix IP address conflict in wondows 7

    to get the message of IP conflict.  Cannot find the repair option which is running XP, to get a new IP.