How to keep a socket live....

Hi,
Any ideas of how I can keep a socket live in a forever loop and pass the incoming data to another socket?
thanks in advance.........

The UnixS class opens a socket to a unix machine
public class Server extends Thread
     UnixS   unix;
     Socket     clnt  = null;
     int     totin = 0;
public Server(Socket soc) 
     clnt = soc;
public void run()
     OutputStream out = null;
     InputStream  in  = null;
     int  i   = 0;
     byte b[] = new byte[120];
     try
          out  = clnt.getOutputStream();
          in   = clnt.getInputStream();
          unix = new UnixS(out);
          unix.start();
          while ((i = in.read(b)) > 0)
               unix.out.write(b,0,i);
               totin = totin + i;
     catch (IOException e){}
     serverV.remove(this);
     try
          in.close();
          out.close();
          unix.out.close();
          unix.in.close();
     catch (IOException e){}

Similar Messages

  • How to keep internet activity live?

    I currently have a filemaker pro database that I use for work. It is located on my local machine because we do not have an in-house server. Is there any way to access that database when I am not logged in and have the database open?
    What are my options? How could I host it on the webserver?
    TIA,
    J3

    The UnixS class opens a socket to a unix machine
    public class Server extends Thread
         UnixS   unix;
         Socket     clnt  = null;
         int     totin = 0;
    public Server(Socket soc) 
         clnt = soc;
    public void run()
         OutputStream out = null;
         InputStream  in  = null;
         int  i   = 0;
         byte b[] = new byte[120];
         try
              out  = clnt.getOutputStream();
              in   = clnt.getInputStream();
              unix = new UnixS(out);
              unix.start();
              while ((i = in.read(b)) > 0)
                   unix.out.write(b,0,i);
                   totin = totin + i;
         catch (IOException e){}
         serverV.remove(this);
         try
              in.close();
              out.close();
              unix.out.close();
              unix.in.close();
         catch (IOException e){}

  • OSB using socket Transport ,how to keep a TCP connection open

    hi my firends,
    i met a problem , our project need build an OSB to control a socket service which is able to transfer a big data file (maybe a voice file,*.wav),and the client program will play the voice file on live.
    So my solution is that : keep a socket (tcp) connection open,client listen port and makes date play.
    but i can't make the OSB socket transport alway open,it will timeout after a few second if have none date received.
    how could i deal with it ... pls let me konw if you have any idea...i will wait you on line
    thanks guys

    Hi,
    I'm not sure if that's achievable using OSB, and even if it was, I don't think OSB was designed having this type of application in mind...
    I understand that you need a media streaming solution and I'm pretty sure that there are plenty of tools out there that can help you in doing that, and maybe some of them can be integrated with OSB in some way...
    Cheers,
    Vlad

  • How to keep multiple function modules under one Web service

    Hi Experts,
    I have Three RFC function modules and i need to create one web service for these three RFC function modules. I know How to crearte a web service for one function module.
    please suggest me How to keep multiple function modules under one Web service.
    Thanks in advance
    Lakshminarayana

    Hi Lakshmi,
    The best way to do it is to assign all the three RFC Enabled FM's to one function group. Later on the top menu in Utilities you get an option to Create a Webservice from a Function Group.
    You can create one single Webservice using all the the 3 FM's.
    I hope this helps.
    Thanks,
    Manu

  • How do I create multiple live USBs of Operating systems to boot from on one flashdrive?

    How do I create multiple live USBs of Operating systems to boot from on one flashdrive?
    I am attempting to create multiple live USBs within one flashdrive so that i can boot various operating systems without having to buy multiple USb sticks. I am using a Mac OS X Snow Leopard 10.6.8 Operating System currently. I am using the Terminal provided by the OS.
    I would like to try Debian, Kali, Precise Puppy, and Sabayon- with one space left empty for whatever Linux OS I would like to try next. I have partitioned an 8GB flashdrive into the following sections:
    name of intended OS,     space allocated for it:
    1)Debian ........................1.32 GB
    2)Kali..............................2.61GB
    3)Precise Puppy..............163.7MB
    4)Sabayon.......................1.77GB
    5)TBD..............................2.14GB
    I have figured out how to change the .iso files of the operating systems into .img files with the following commands:
    hdiutil convert -format UDRW /path/to/input.iso -o /path/to/output.img
    a .img.dmg file is created, this is corrected in the next line of code *please note: I am a a very beginner at programming, and would greatly appreciate any help. Thank you!
    mv /path/to/output/file.img{.dmg,}
    This is where I started to get confused:
    I entered diskutil list to find the location of the partitions on my flashdrive, and this is the relevant section:
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *8.0 GB     disk1
       1:                 DOS_FAT_32 DEBIAN               1.3 GB     disk1s1
       2:                 DOS_FAT_32 KALI                    2.6 GB     disk1s2
       3:                 DOS_FAT_32 PRECISE            163.7 MB   disk1s3
       4:                 DOS_FAT_32 SABAYON           1.8 GB     disk1s5
       5:                 DOS_FAT_32 TBD                     2.1 GB     disk1s6
    This is the code I attempted to use and the subsequent result:
    charles-burtons-mac-mini:~ charlesburton$ sudo dd if=/Users/charlesburton/Desktop/debian-live-7.2-i386-gnome-desktop.img of=/dev/disk1s1 bs=1m
    dd: /dev/disk1s1: Resource busy
    *at this point I went to the Disk Utility GUi and unmounted only the DEBIAN partition, now back to the terminal*
    charles-burtons-mac-mini:~ charlesburton$ sudo dd if=/Users/charlesburton/Desktop/debian-live-7.2-i386-gnome-desktop.img of=/dev/disk1s1 bs=1m
    dd: /dev/disk1s1: end of device
    1259+0 records in
    1258+1 records out
    1320005632 bytes transferred in 1011.966891 secs (1304396 bytes/sec)
    Please may someone help explain why I had a return value of +1 in my records in and how I can make it work properly.

    I would like to know the answer to this as well.  I tried renaming the 3D version by adding 3D after it, but it still not a separate movie in iTunes.
    It's putting them in the same folder.

  • How to keep FI posting period (OB52) closed but keep CO posting periods (OK

    Hi SAP Guru's,
    how to keep FI posting period (OB52) closed but keep CO posting periods (OKP1) open.
    I.e. on Oct 21th the FI posting period 10 should be open but FI posting period 09 should be closed. But on Oct 21th the CO posting period 09 should be open.
    Thanks in Advance.
    RV

    You've already activeted. You can check in IMG-Financial Accounting Global Settings (New) ® Ledgers ® Real-Time Integration of Controlling with Financial Accounting
    Check this for more info http://help.sap.com/saphelp_dimp50/helpdata/en/22/c2cf4031288131e10000000a1550b0/content.htm

  • How to keep file name in print queue when printing crystal report

    We are using VB .Net 2003 + Crystal Report 2008 SP2 up to Fix Pack 2.6
    When the VB program spools crystal report files to print queue, the print queue only shows "Crystal Report" for each document.  How to keep the original file name?  In the past when we were using Crystal Report 11, the original file name can be shown in the print queue.
    Please help because it's so important for operation to see which report is failed in printing when reports are printed in batch.
    Thanks

    Hello,
    Set the PrintOption.JobTitle value for the print job. Here's C# code on how to:
                   System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument();
                CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions rasPROpts = new CrystalDecisions.ReportAppServer.Controllers.PrintReportOptionsClass();
                CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions newOpts = new PrintOptionsClass();
                   pDoc.PrinterSettings.PrinterName = cboCurrentPrinters.Text;          
                   rasPROpts.PrinterName = cboCurrentPrinters.Text;               
                   rasPROpts.PaperSize = (CrPaperSizeEnum)
                        pDoc.PrinterSettings.PaperSizes[cboCurrentPaperSizes.SelectedIndex].Kind;
                // this sets the name of the print job
                rasPROpts.JobTitle = "MYPrintJob";
                   rptClientDoc.PrintOutputController.PrintReport(rasPROpts);
                   MessageBox.Show("Printing report.", "RAS", MessageBoxButtons.OK,MessageBoxIcon.Information );
    Thank you
    Don

  • Macbook Pro - How to keep a low cycle count

    hey everyone,
    Basically I purchased a new macbook pro 11 days ago, and My current cycle count is also 11. I am eager to keep my cycle count down this time round as my last macbook's battery died at around the 700 mark (the laptop was around 15 months old at the time) which I am told was very high. The average apparently being around 300 for a computer that old.
    I have also read on other forums that people have managed to keep their cycle counts much much lower than 300 even for laptops over 15 months old.
    So to maintain my battery's life this time round I was wondering if anyone had any tips on how to keep the cycle count down this time round?
    Many thanks,
    Josh

    I should point out that the batteries that seem to survive the longest are those that get used--i.e. relatively high cycle counts. They are like muscles--use them or lose them. I tried keeping cycles down on my first battery and the results were that it made it only 11 months. Most of the "my battery failed..." posts we see here show a low cycle count.
    Also, you've posted a question about a new MBP in the forum for older ones made in Early 2008 and before. As the battery technology in your new MBP is different (and apparently better) and you have other hardware improvement made since 2008, you should use the forum for the current-generation MBPs here:
    http://discussions.apple.com/category.jspa?categoryID=251
    Not to worry. It's not your fault you found the wrong forum. "Original MacBook Pro" is a pretty non-intuitive label! About a dozen people a day with new MBPs end up here and sometimes get inappropriate advise if responders either don't notice of can't tell that the OP is asking about a newer Mac.

  • How to keep all text and formats the same on multiple computers?

    I'm creating a file in InDesign CS6 on my Windows computer. I keep everything on my flash drive. When I go to school, I bring my flash drive with me and open it up on the Mac computer, but then there are are compatibility issues. There seems to be missing fonts and formats but the school uses the same version of InDesign I do. Now I was told a lot of things of how to keep the fonts and formats the same (embed the links, package the files, outline the text, save as IDML). However, it is not clear to me what each of those options do, so I don't know when or why to use them. So I just want to make sure that when I bring in my file in next Monday, I won't have any missing fonts or formats. What would you suggest is the proper things to do to keep everything the same on multiple computers? And could you please explain why?

    If you want cross-paltform comaptibility limit the fonts to OpenType or Windows TrueType formats, both of which work on both Mac and PC. To avoid missing font warnings the fonts must either be installed on each computer, or they must be in a folder named Document Fonts in the same location as the .indd file they are to work with. Packaging the file will build taht folder for you.
    the rest of the stuff in your list won't help you. .idml would allow you to open on an older version, but does nothing for your situation. Embedding the links will keep you from having missing links, but so will packaging, and embedded links will make the file much larger and harder to work with.
    For goodness sake, don't even think about outlining the text. It stops being text when you do that and you can no longer edit it.
    And finally. do yourself a big favor and don't attempt to actually work on your file directly from the flash drive. Copy the whole package folder to the hard drive, work on it, then copy back. You don't want to know how many files are fatally damaged by write errors on flash drives.

  • Does anyone know how to keep all songs in the same album when they say featuring someone?

    Each time I load a CD onto Itunes that has an artist who features another artist on that particular song, it puts it in my library as a separate CD even though it will have the same album listed.  For instance Lady Gaga's song just dance features Colby O'Donnis that song is in its own spot while the rest of the cd is together that one song is separate and I don't know how to keep them all together.  Someone help.

    Get the Informations for that song and have a look in the "Sorting" area if there is something different. The data inserted there is just for how iTunes will order the songs.
    If the Interpret in the general informations is "Lady Gaga" and in the sorting area is "Lady Gaga feat. xxxx" than you'll see Lady Gaga as the interpret but it's sort to a second entry "Lady Gaga feat. xxxx".

  • How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC?

    How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC? When I create rectangle I can't transform it by dragging and it's only the problem with rectangle, not with circle, star etc. I try show/hide edges/bounding box reset preferences and reinstall whole illustrator CC and it's the same. I can only make this right by expand this rectangle, which is shape as is turn out to rectangle by clicking object>shape>expand rectangle. But this is so frustrating. Help!:) oh, and I use OSX. My friend has the same specs and it's works. I mean she can use live shape corner transformations and changing size by draging:(

    I’ve created my own plugin (available for free for personal and commercial use) which imitates behavior of the ‘old’ Rectangle Tool. It doesn’t replace the Live Rectangle – it works completely independent!
    My Plain Rectangle Tool correctly snaps to grids/objects/points and correctly aligns to grid/points on resize. Of course it supports the SHIFT and ALT/OPTION keys, Snap to Grid and Smart Guides options. In other words it works almost 100% the same as the Rectangle Tool we know from CC (17.1), CS6 and earlier.
    The installation package (zxp) adds ‘Plain Rectangle Tool’ icon into the Ai panel (of curse you can assign your custom keyboard shortcut to it as well)
    Note: The Plain Rectangle can be easily converted into the Live one using Object > Shape > Convert to Rectangle
    Grab your copy at http://63mutants.com/subc/products/PlainRectangleTool_m01/PlainRectangleTool_m01.php Feel free to share with your friends. It’s completely free.
    I’ve also created a separate discussion https://forums.adobe.com/thread/1587587 for the Plain Rectangle Tool. If you have any comments or request please post it there. Any feedback would be greatly appreciated!
    Thanks,
    Pawel Kuc

  • How to keep songs on iphone, work computer and home computer the same?

    How to keep songs on iphone, work computer and home computer the same?
    This seems like something everyone would want to do. I don't know why Apple won't give us a simple solution. They could even charge us for it. I would pay!
    Has anyone solved this? What is your solution?
    Thanks!
    [email protected]

    If you just want to be able to sync your devices to the same PC without having them get overwritten all the times, here is a free method
    http://cnettv.cnet.com/sync-your-ipod-two-computers/9742-1_53-50004835.html
    Basically, you put the same itunes database file on all the PCs. This fakes itunes into thinking it is always the same PC and the ipod is OK to sync with it. It will NOT keep your libraries truly synced, though. I've just resigned myself to always buying from one PC and manually transferring the content to other PCs I want it on.

  • How to keep track of how many times a link has been clicked?

    How to keep track of how many times a link has been clicked or accessed? Do I need to use database for this?

    Hi
    Proably something like this can work,
    1> Have a servlet/bean invoked when the link is linked
    2> have a static variable in that servlet/bean wich gets incremented before the control is passed to another desired page..
    The problem with this approach is that care has to be taken that the servlet/bean is not re-instalised, in case of which the static variable will also be instalised and the data would be lost.
    The best thing is to store the count in the database.
    Regards
    Arathi.

  • How to keep the WBS & Order in account assignment tab of SD contract item?

    Hi Experts,
    If I remove the plant from the shipping tab in the contract item (the contract type is WV), I will be able to enter the WBS or Order in accounting assignment tab. However, if I enter the plant (in order to determine the tax in pricing), the WBS and Order are disappered and there is one new settlement rule button showed up.
    Do you know any configuration could keep the WBS and order in the accounting assigment tab even the plant is there.
    Thanks in advance!
    Norman

    Hi Chandra,
    Thanks for your answer. However, I even added the plant in the WBS, the tax (we use tax jurisdiction) still could not be determined.
    The problem is that SAP changes the account assignment tab screen (it suppresses the WBS and Order fields, but addes settlement rule) with the plant in the shipping tab. Do you know how to keep the same account assignment tab screen with the plant in the shipping tab?
    Thanks,
    Norman

  • How to keep email messages on iPhone using iCloud

    I can't figure out how to keep opened email on my iPhone.  If I have previously opened message on my iMac and it is in the Inbox on my iPhone, it disappears as soon as I try to open it.    Often I want to re-read a message.   Surely there must be a way to keep them for a period of time on the iPhone.
    John

    You could just pay for backup space (if iCloud offers it). I am only familiar with MobileMe, so I am not sure. This may help.

Maybe you are looking for

  • Satellite L300 - Recovery wipes C drive then fails to rebuild

    My Satellite L300 has just come back from Toshiba for repair under warranty and before having a chance to burn Recovery Disks came up with the BSOD. Removed hard drive and placed in a SATA cradle and ran chkdsk which repaired it to the extent that (b

  • Can't figure out JVM instructions

    Could anybody help me to decompile the following code? Seems to be a switch statement but I can't get real code out of these instructions. I've stripped away some lines of unnecessary (as I think) code. Most of all I am confused about this line : if(

  • Texts not getting populate in idoc for Purchase Order

    Hi, While transfering PO from MM to SRM thru XI texts at the item level n header level are not populating in ithe idoc segments. Please let us know the solution. Regards, Manu

  • Facebook app won't work.

    I just got my phone a few days ago. I download the facebook app today and it says that i'm on a service plan that does not support that application, but I have the Blackberry Social add-on.

  • Wireless Keyboard during Setup

    Hi I just got a new Mac mini today, but am struggling with setup. The assistant pairs my wireless keyboard (it's an apple one from about 4 years ago) but it doesn't work - i.e. I can't enter any text. So I can't complete the setup.... Any ideas? Are