Java ¶àÏ̺߳ÍSocket - Java / JavaÏà¹Ø
import java.net.*;
import java.io.*;
class Server
{
public static void main(String[] args)
{
MuiThread mt=new MuiThread();
new Thread(mt).start();
}
}
class MuiThread implements Runnable
{
ServerSocket ss;
Socket s;
InputStream is;
OutputStream os;
String str;
MuiThread()
{
ss=null;
s=null;
is=null;
os=null;
str=null;
}
public void run()
{
try
{
ss=new ServerSocket(5000);
while(true)
{
s=ss.accept();
is=s.getInputStream();
os=s.getOutputStream();
os.write("Welcome".getBytes());
byte[] b=new byte[100];
int len=is.read(b);
str=new String(b,0,len);
if (str.equals("e"))
{
os.write("the Server will close at once".getBytes());
System.out.println("Client is Disconnectiong");
}
else
{
System.out.println(str);
}
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
ΪʲôÕâ¶Ë³ÌÐòÖ»ÄÜÓÐÒ»¸ö¿Í»§¶ËÁ¬½Ó??
лл
ÎÒÏëÊÇÒòΪ¶Ë¿Ú 5000
²»¹Ü¶àÉÙ¸öỊ̈߳¬ÄãÖ»ÄÜÓÐÒ»¸ö·þÎñÏ߳̿ÉÒ԰󶨵½5000ÉÏ
ûÓÐÃ÷°×
ÄãÓ¦¸ÃÔÚwhileÀï´´½¨Ò»¸öеÄÏß³ÌÓ뵱ǰµÄsocket¶ÔÓ¦¡£
´´½¨ÐÂÏ̵߳Äʱºò£¬ÒÔsocket×÷Ϊ²ÎÊý¡£È»ºó¼ÌÐ
Ïà¹ØÎÊ´ð£º
ÎÊÌâÃèÊö£ºÐ´ÈÕÖ¾¹¦ÄÜ£¬Ð´ºÃµÄдÈÕÖ¾·þÎñ£¬ÆäËûÓû§Í¨¹ýhttpµ÷Ó÷þÎñ£¬´«Èë²ÎÊý£¬È»ºó¼Ç¼ÈÕÖ¾£¬
ÎҵķþÎñ¸ÃÔõôд£¬ ±ðÈËÔõôͨ¹ýhttpµ÷ÓÃÎҵķþÎñ£¬ÎÒÓÃwebserviceдºÃÁËÒ»¸ö£¬¿ÉÊDz¢·¢ÓÐÉÏÏߣ¬Ïë¸ÄÓ ......
private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl";
private static final String USERNAME = "sys";
private static final String PASSWORD = "s ......
ÔÚaspÀïÔõôµ÷ÓÃjavaдµÄwebservice·½·¨£¬Óкܶ෽·¨
- <message name="RtPnrIn">
<part name="bstrPnrNO" type="s:string" />
<part name ......
¸÷·´óÏÀ¸ø¸ö˼·£¬²»ÊÇÔÚÏßµÄÄÇÖÖ£¬¾ÍÊÇÒ»¸ö×öÆÕͨµÄÓ¦ÓóÌÐò¡£
´Ê¿âÔõôÉú³ÉÄØ£¿
²»»á¡£
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
ÕÒ±¾×Öµä
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
Êý¾Ý¿â ºÇºÇ
ÓÃmap ¼üÖµ¶ÔÓ¦
Èç¹ûÓÃÊý¾Ý¿ ......