如何用java实现socket技术?另外,请教哪有jbuilder的中文使用手册下载(电子版)?

lanlaser 2002-03-27 09:03:54
如何用java实现socket技术?谢谢
请告诉原代码?
请教哪有jbuilder的中文使用手册下载(电子版)?
...全文
108 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aprim 2002-03-28
  • 打赏
  • 举报
回复
请教哪有jbuilder的中文使用手册下载(电子版)?

-------------------------------------------
这样的树有用码??
xiaohaozi 2002-03-28
  • 打赏
  • 举报
回复
哦,你要jb6.0的可能没有哦,网上有5.0的,www.269.net你去看看!
GJA106 2002-03-28
  • 打赏
  • 举报
回复
jbuilder中文使用手册到书店去买吧。

服务端程序:
package pSocket;

import java.io.*;
import java.net.*;
import java.util.Vector;

/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2001</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/

public class TestSocketServer
{
ServerSocket mServerSocket = null;
Socket mSocket = null;
DataInputStream dis = null;
DataOutputStream dos = null;
Vector mVector = null;
public TestSocketServer()
{
try
{
mServerSocket = new ServerSocket(9009,15);
mSocket = mServerSocket.accept();

dis = new DataInputStream(mSocket.getInputStream());
ObjectInputStream ois = new ObjectInputStream(dis);
mVector = (Vector)ois.readObject();
for(int i = 0 ; i < mVector.size(); i ++)
{
System.out.println("输出:" + (String)mVector.elementAt(i));
}
}
catch(Exception eSocket)
{
}
}

public static void main(String [] args)
{
new TestSocketServer();
}
}

客户端程序:
package pSocket;

import java.io.*;
import java.net.*;
import java.util.Vector;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2001</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/

public class TestSocketClient
{
Socket mSocket = null;
DataInputStream dis = null;
DataOutputStream dos = null;
Vector mVector = new Vector(5,1);
public TestSocketClient(String [] args)
{
mVector.addElement("aa");
mVector.addElement("bb");
try
{
mSocket = new Socket("192.188.0.5",9009);

dos = new DataOutputStream(mSocket.getOutputStream());
ObjectOutputStream oos = new ObjectOutputStream(dos);
oos.writeObject(mVector);
}
catch(Exception eSocket)
{
}
}

public static void main(String [] args)
{

new TestSocketClient(args);
}
}

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧