About the socket security problem,Plese help.

I use the port 843 server to send xml to swf.But not work. Please help. My Code is:
Server:
//HelloTest.java
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
//让其继承线程类是为了更好控制 其余的线程
public class HelloTest extends Thread {
* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub
//发送策略的服务器
new HelloTest().start();
//这个是用的fuq
new Thread(new QtServer()).start();
@Override
public void run()
System.out.println("策略服务器启动");
  boolean lising=true;
ServerSocket ss;
try {
ss = new ServerSocket(843);
while(lising)
try {
//得到socket服务器
  Socket sc=ss.accept();
SendPolicyFile sp=new SendPolicyFile(sc);
System.out.println("为什么呢");
new Thread(sp).start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
ss.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
//SendPolicyFile.java
public class SendPolicyFile implements Runnable {
private Socket soc;
private OutputStream _socketOut;
private InputStream _socketIn;
public SendPolicyFile(Socket s) throws IOException
this.soc=s;
_socketOut=s.getOutputStream();
_socketIn=s.getInputStream();
//设置超时的限制
//soc.setSoTimeout(1000);
public void run() {
// TODO Auto-generated method stub
    try {
readRandSp();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@SuppressWarnings("unused")
private void readRandSp() throws IOException
  if(read().equals("<policy-file-request/>"))
  System.out.println("write Policy to flash");
  writePolicy();
        //close stream and socket
  close();
//写策略文件的方法
private void writePolicy() throws IOException
   String string1="<?xml version=\"utf-8\" ?><cross-domain-policy><site-control permitted-cross-domain-policies=\"master-only\"/><allow-access-from domain=\"*\" to-ports=\"8001\"/></cross-domain-policy>"+"\u0000";
PrintWriter pw=new PrintWriter(_socketOut);
pw.println(string1+"\u0000");
pw.flush();
pw.close();
System.out.println(string1+"\u0000");
//关闭流
//关闭socket
public void close()
  if(_socketOut!=null)
try {
_socketOut.close();
if(_socketIn!=null)
  _socketIn.close();
  if(soc!=null)
  soc.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
_socketIn=null;
_socketOut=null;
soc=null;
//发送两个Socket
private String read() throws IOException
System.out.println("这里也执行吗");
StringBuffer buffer=new StringBuffer();
int codePoint;
boolean zeroByteRead=false;
do{
//这个地方阻塞了
codePoint=this._socketIn.read();
//如果接受到的codePoint为null那证明客户端与我们失去连接了
if(codePoint==0)
  zeroByteRead=true;
else
buffer.appendCodePoint(codePoint);
while(!zeroByteRead && buffer.length()<30);
return buffer.toString();

I use the port 843 server to send xml to swf.But not work. Please help. My Code is:
Server:
//HelloTest.java
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
//让其继承线程类是为了更好控制 其余的线程
public class HelloTest extends Thread {
* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub
//发送策略的服务器
new HelloTest().start();
//这个是用的fuq
new Thread(new QtServer()).start();
@Override
public void run()
System.out.println("策略服务器启动");
  boolean lising=true;
ServerSocket ss;
try {
ss = new ServerSocket(843);
while(lising)
try {
//得到socket服务器
  Socket sc=ss.accept();
SendPolicyFile sp=new SendPolicyFile(sc);
System.out.println("为什么呢");
new Thread(sp).start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
ss.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
//SendPolicyFile.java
public class SendPolicyFile implements Runnable {
private Socket soc;
private OutputStream _socketOut;
private InputStream _socketIn;
public SendPolicyFile(Socket s) throws IOException
this.soc=s;
_socketOut=s.getOutputStream();
_socketIn=s.getInputStream();
//设置超时的限制
//soc.setSoTimeout(1000);
public void run() {
// TODO Auto-generated method stub
    try {
readRandSp();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@SuppressWarnings("unused")
private void readRandSp() throws IOException
  if(read().equals("<policy-file-request/>"))
  System.out.println("write Policy to flash");
  writePolicy();
        //close stream and socket
  close();
//写策略文件的方法
private void writePolicy() throws IOException
   String string1="<?xml version=\"utf-8\" ?><cross-domain-policy><site-control permitted-cross-domain-policies=\"master-only\"/><allow-access-from domain=\"*\" to-ports=\"8001\"/></cross-domain-policy>"+"\u0000";
PrintWriter pw=new PrintWriter(_socketOut);
pw.println(string1+"\u0000");
pw.flush();
pw.close();
System.out.println(string1+"\u0000");
//关闭流
//关闭socket
public void close()
  if(_socketOut!=null)
try {
_socketOut.close();
if(_socketIn!=null)
  _socketIn.close();
  if(soc!=null)
  soc.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
_socketIn=null;
_socketOut=null;
soc=null;
//发送两个Socket
private String read() throws IOException
System.out.println("这里也执行吗");
StringBuffer buffer=new StringBuffer();
int codePoint;
boolean zeroByteRead=false;
do{
//这个地方阻塞了
codePoint=this._socketIn.read();
//如果接受到的codePoint为null那证明客户端与我们失去连接了
if(codePoint==0)
  zeroByteRead=true;
else
buffer.appendCodePoint(codePoint);
while(!zeroByteRead && buffer.length()<30);
return buffer.toString();

Similar Messages

  • I did not activate the backup email. and I'm not sure about the answer security. Please help me!

    I created a id apple. then I forgot to activate the reserve by email. I still remember my secret question, but I'm not sure about i was using accented characters or spaces. language in my country. That was my fault. I want to ask the apple support can assist me? . I tried to find it on the website but I do not speak much english for a call request. Do you can send email to me reactivated by email backup or help me answer my security question . My ipad is now locked and can not be used. Please help me !

    Find someone who speaks english to help you and contact Apple. Good luck.

  • HT201303 I forgot answer my security questions plese help me

    i forgot answer my security questions plese help me

    Click here for information. If the option to have the answers emailed to you isn't available or doesn't work(the email may take a few hours to arrive), contact the iTunes Store staff via the link in the 'Additional Information' section of that article.
    Nobody on these boards can reset them for you.
    (91141)

  • Got a MacBook with 10.5.8  I am anable to burn cds, dvds, and dl dvds.  Everything worked before I reformatted my computer but now it comes up with error messages like unable to communicate or something about the laser power levels.  Help! Anyway to check

    Got a MacBook with 10.5.8  I am anable to burn cds, dvds, and dl dvds.  Everything worked before I reformatted my computer but now it comes up with error messages like unable to communicate or something about the laser power levels.  Help! Anyway to check to see what is going on?

    Hi I am having the identical problem with my 24" intel iMac 2007..... Did you ever figure out what the problem was? I'm on round 3 now and with a completely blank grey screen and it won't start up from the disk 1.. I also have diskwarrior and techtool pro as well as the osx leopard and snow leopard disk... The HD is new.. Replaced by apple 3 months ago.. Don't know the cause the first time this happened about 9 months ago.. 2nd time, 6 months ago it never rebooted from the office for mac 2008 critical update... Did a clean install after backing up to TC... Took it to apple replaced HD even though it appeared ok, they checked all hardware and I ran techtool pro daily ever since. Last week software update had several updates avail. Office for mac being one of them.. I updated and have never booted since.. . I swear to never ever use another Microsoft product as long as I live if I can just fix this once more... Help me please

  • HT1338 There is a lot of talk about the Java security issues and the ability to download a patch fix, do i need to do this or will software update pick this up for me?

    There is a lot of talk about the Java security issues and the ability to download an apple patch fix, do i need to do this or will software update pick this up for me?

    Thanks for that, how do I establish if I have Java installed as on Safari preferences it indicates the following
    Web content - Enable Java
                        - Enable JavaScript

  • I can't get the leapfrog connect to open.  It says something about the Testgen fonts.  Please help.

    I need help with the leapfrog connect application.  It won't open and it keeps saying something about the font Testgen.  Please help me if you can.

    Considering that the "Most recent updates" link on the Leapfrog Connect homepage is dated November 2009, I wouldn't hold out too much hope that your software is compatible with Lion, released in July 2011.

  • Any latest news about the Microphone Boost problem?

    Hi,
    I'm using the SB X-FI Titanium and I have the well-known problem that my mic is too low, but can't fix it cause the creative console doesn't have MicBoost. ? It's definitely not a mic-problem cause I tried two different mics.
    Are there any latest news about that, may be official/not official drivers? Or ist there another way to activate MicBoost for my X-FI?
    Greeting
    foxx

    Some serious sources say that a new set of nForce drivers are in its way to release.
    Some modules has been rewritten, so thats why their late release.
    Just some last minute bugfixing, and they will hit our nForce systems!!!

  • Help!! Can someone help me with this message I keep getting before startup, please ?? Here it is: "/Library/Startupitems/Intego Backup Manager Pro" has not been started because it does not  have the proper security settings. Help!?!?

    Hello:
    I keep getting this message upon startup. Can't figure out how to address it. Here it is.
    "/Library/Startupitems/Intego Backup Manager Pro" has not been started because it does not have the proper security settings.
    Any suggestions?

    There's an invisible one name "Icon" according to the error message.
    Enable Finder to Show Invisible Files and Folders
    Open the Terminal application in your Utilities folder.  At the prompt enter or paste the following command line then press RETURN.
    defaults write com.apple.finder AppleShowAllFiles TRUE
    killall Finder
    To turn off the display of invisible files and folders enter or paste the following command line and press RETURN.
    defaults write com.apple.finder AppleShowAllFiles FALSE
    killall Finder
    Alternatively you can use one of the numerous third-party utilities such as TinkerTool or ShowHideInvisibleFiles - VersionTracker or MacUpdate.
    First, make invisible files visible. Find the invisible file in that folder and remove it. Please be sure you are looking in the /Library/StartupItems/ folder. There is another one in the /Home/Library/ folder. Be sure you look in the right one.

  • HT5312 Okay, this explains about the rescue email, but not about resetting your security questions? Help please?

    I have a bad memory and I can't remember the answers to my security questions, so I need to reset them, although I have no clue how to do that....

    Click here and request assistance.
    (75393)

  • My phone switches off after showing horizontal lines on the screen during the restore process and then shows the error 9 problem. please help i am so stressed.

    Hello
    My iphone  4S switches off after showing horizontal lines on the screen cutting through the apple logo during the restore process and then right after my iTunes shows the error 9 message, this happened 2 days ago when my phone just switched off unexpectedily and has been in this recovery mode since then. i have watched videos on Youtube and i have disabled Firewall before starting the process, i think i have done almost everything. please help anyone what do i do from here?
    Just for interest sake i watched this video on youtube where this guy had the same problem  but the difference is that he had it on an iPad. he opened the ipad up and did something on the ipad, it took less than a minute then his ipad worked.
    I would appreciate it if someone would respond to this as fast as they can i am so stressed.
    Regards
    Lwando

    Read here:
    http://support.apple.com/kb/ts3694#9
    Error 9 is usually a security software issue.

  • Today is HP Expert Day - someone ask about the Beats audio problem!

    Let's do it!

    Hi
    Try fn+b toggle just open more and more of the Beats.exe process. I too have had this issue. The fix is a simple one.
    Make sure you have the SWSETUP folder from the factory install backed up. If not, you need to get a copy of the HPTONECONTROL HPQUICKLAUNCH, and the IDT DRIVER (Audio driver) from that folder.
    I tried to get these drivers and programs from the HP support website for the Envy 17, fn+b with these just causes more and more of the Beats.exe process to open up. Even getting HPQUICKLAUNCH and the IDT DRIVER from the HP Support website for my Envy 17 did not give me a working Beats Audio.
    Note that HPTONECONTROL is not listed on the HP Support website. You must get this from the SWSETUP folder.
    I have tested different combinations of different versions of HPQUICKLAUNCH, HPTONECONTROL, and the IDT DRIVER. Only the factory default versions of these actually give a working Beats Audio and fn+b toggle.
    Hope this helps and saves you the trouble. Now time to figure out how to get back my life. 
    Edit: This applies to the Envy 17 and Envy 14 since they both use the HM55 chipset.
    Let us know how it goes!
    "I work for HP."
    ****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath

  • Couldn't find the answer to this in any other forum about the MacProtector Malware.  Please HELP!!!

    I clicked on a link while reading a story about vegetarian athletes today and the MacProtector malware downloaded to my computer.  I DID NOT install the application when the installer opened.  I immediately started searching for support on what to do.  I exited the installer and rebooted in safe mode.  I found the program in the downloads menu and put it in the trash.  I emptied my trash.  I have looked through all of the possible places the program could be hiding and I did not see anything.  Am I safe?  Should I still change my password?  Also, will the virus be able to find my credit card information linked to iTunes or any other shopping websites?  Should I start using Foxfire permanently instead of safari?
    I would appreciate any help- even though I know this has been discussed quite a bit!

    Hi, here is how to remove it by yourself...
    http://goo.gl/J7R6A
    Script that I create which, will help you remove it ..... (Let me know using the contact at that site.)
    http://goo.gl/rGV62
    What is does.
    Depending on the version it just creates a bunch of random fake notification and claims your infected. If you keep getting it then most likely you have Allow popups and "Open Safe files" in safari on. The only damage is if you give the criminals that created it your Credit Card.
    It is changing so it depend on the version but these two links should help.

  • Security------problem,please help

    how do i access WindowsNT user/password using java ? and then depending upon the user wheather he is a normal user or administrator i have to do some task,can any one suggest a way ,an example will be a great help
    Thanking in Adavnce

    If you are using Websphere, I know that there is a way to configure your global security to use the local OS registry. It is not too difficult, if you understand and are comfortable with the Admin Console.

  • Cant see some mail.. something about the email wasnt downloaded.. help..

    Couple times a day, I get this message:
    The message from "amber ruiz" <[email protected]> concerning “Customer Contact: Website Time-Out” has not been downloaded from the server. You need to take this account online in order to download it.
    Not that exact message mind you, as its for different emails from different people. The only way to see the email is to restart mail. Then I can see it just fine. Anybody know why this is happening?
    10.3.9
    Mail version: 1.3.11 (v622)
    Thanks

    Yes sir,,,
    When I open the folder "INBOX.mbox" I see two items. One is a file called "Info.plist" , and the other is a Folder named "Messages". With-in that folder named "Messages" is nothing,,, it is empty. Which bothers me because I HAD 5 messages in that accounts box that I was holding on to because they said that thing (about not being downloaded from server, etc..)...
    BUT then like I said, I "Rebuilt" that accounts mailbox thinking that would help me, but with no warning alert or anything, it just seemed to clean up that box and the messages just disappeared in front of my eyes !!
    But I thought for sure they would still be somewhere on my hard drive.....
    Am I mistaken ?? And because there is no files in that folder named "Messages" does that mean I have absolutely NO messages from that account to dig up from anywhere ??
    Thanks for the help Allan,,, sorry to be so detailed and full of questions, its just that this issue really is throwing me for a loop here...
    G5 Dual 2.7, 4.5Gb Ram, Two 74Gb WD Rapture 10k rpm hard drives for Boot Drive & extra SATA Drive.   Mac OS X (10.4.3)  

  • Video problem plese help!!

    ok so i have some music videos in itnes right, i converted them to the MPEG format, and theyre in the music vids playlist. but, when i plug in my ipod to update it, they dont appear ANYWHERE on my ipod. id really appreciate it if someone could help me.
    thanx

    This is a good place to start:
    Frequently asked questions about viewing and syncing video with iTunes and iPod

Maybe you are looking for

  • ITunes Library change. Please help me!

    Hey guys I have a problem. I want to change my iTunes library. If I open iTunes the title of the program (above of the apple image up in the middle of the screen) is "Previous iTunes Library". But I want to get back my actual library! I dont know how

  • Error in dynamic cursor::

    hi experts please help me for this error In this code the cursor conditions are not appending to the query so when i am executing the result it is displaying the error can you help me on this SQL> CREATE OR REPLACE PROCEDURE test_dynamic_detailed_rpt

  • Update to Adoebe Reader XI not possible

    Mir wird angezeigt: "Initialisierung ist fehlgeschlagen"

  • Approval of physical Inventory doc

    Dear Exxperts, Can we set release strategy for physical inventory docs. Client is asking for approval of inventory count doc before posting of diiferene. Can you please expedite , how to handle the issue?? REgards, Santosh

  • Is there a cs6 in multilanguage?

    Hi is there a cs6 in multilanguage? i mean after the installation , i can set the language , italian or german or english in short have the possibility to work with cs6 in english ,so i can enjoy the tutorials and after change the language in italian