Z
zzz
Unregistered / Unconfirmed
GUEST, unregistred user!
我的Java Applet中用URL连接Delphi中的Socket Server。上传部分没有问题,Delphi 的
Socket正常接收了前端的请求,但当我用MemoryStream向Applet写字符串时,Applet产生
Exception,为什么?程序如下:
Applet 中:
URL url = new URL("http://123.123.123.123/1.html");
try{
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()."GB2312"));
do
{
}
while ...
}
catch(Exception e){
}
在Delphi端我是这样写的:
TmpStr : string;
Buf : Array[0..1023] of Char;
TMemoryStream stream = TMemoryStream.Create;
TmpStr := 'sajadsflkjsadfkjsadkjfsadkf';
StrPCopy(Buf,TmpStr);
stream.WriteBuffer(Buf,length(TmpStr))
Socket.SendStreamthen
Drop(stream);
Delphi端的Socket一写马上让Applet产生Exception,为什么?
Socket正常接收了前端的请求,但当我用MemoryStream向Applet写字符串时,Applet产生
Exception,为什么?程序如下:
Applet 中:
URL url = new URL("http://123.123.123.123/1.html");
try{
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()."GB2312"));
do
{
}
while ...
}
catch(Exception e){
}
在Delphi端我是这样写的:
TmpStr : string;
Buf : Array[0..1023] of Char;
TMemoryStream stream = TMemoryStream.Create;
TmpStr := 'sajadsflkjsadfkjsadkjfsadkf';
StrPCopy(Buf,TmpStr);
stream.WriteBuffer(Buf,length(TmpStr))
Socket.SendStreamthen
Drop(stream);
Delphi端的Socket一写马上让Applet产生Exception,为什么?