我的问题是,当我在另一个网络(我的电话热点)上运行客户端时,出现“ java.net.ConnectException:连接被拒绝:connect”异常。它可以在同一网络上正常工作,我认为这是防火墙的问题,但是即使在启用Eclipse并为每种类型的网络禁用防火墙之后,它仍然无法正常工作。
客户:
import java.io.*;
import java.net.*;
public class MyServer {
public static void main(String[] args){
try{
System.out.println("Server Running");
ServerSocket ss=new ServerSocket(6666);
Socket s=ss.accept();
DataInputStream dis=new DataInputStream(s.getInputStream());
String str=(String)dis.readUTF();
System.out.println("message= "+str);
ss.close();
}catch(Exception e){System.out.println(e);}
}
}
服务器:
dataWrap.override.stdWrap.cObject = COA
dataWrap.override.stdWrap.cObject {
10 = TEXT
10.dataWrap = <section class="content video {field:flexform_mdCol1} {field:flexform_mdCol2} {field:flexform_col21class}
20 = TEXT
20.value = " style="background-image: url(/
30 = IMG_RESOURCE
30 {
file.import.data = field:flexform_mdCol3
}
40 = TEXT
40.value = );">
50 = TEXT
50.value = <video width="1920" height="1080" autoplay loop muted playsinline poster="/
60 = IMG_RESOURCE
60 {
file.import.data = field:flexform_mdCol3
}
70 = TEXT
70.value = ">
75 = CONTENT
75 {
table = tt_content
select {
table = tt_content
uid.data = field:uid
}
renderObj = COA
renderObj {
10 = TEXT
10 {
data = flexform: pi_flexform:flexform_mdCol4
}
}
}
80 = TEXT
80.value = <source src="/
90 = FILES
90 {
files.dataWrap = {field:flexform_mdCol4}
renderObj = TEXT
renderObj.stdWrap.data = file:current:publicUrl
renderObj.stdWrap.wrap = |
}
100 = TEXT
100.value = " type="video/mp4"></video>|</section>
}
dataWrap.override.if.isTrue.field = flexform_mdCol4