?? exdatagram.java
字號:
package exframework;
/**
* <p>Title: ExFramework</p>
*
* <p>Description: lizhenpeng</p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: LP&P</p>
*
* @author lipeng
* @version 1.0
*/
import javax.microedition.io.*;
public class ExDatagram implements AllAction
{
DatagramConnection conn;
public ExDatagram()
{
}
public void allAction(MainForm form)
{
try
{
conn=(DatagramConnection)Connector.open("datagram://localhost:8070");
Datagram dg=conn.newDatagram(1);
byte []buffer;
buffer = new byte[1];
buffer[0] = 1;
dg.setData(buffer,0,buffer.length);
conn.send(dg);
conn.receive(dg);
form.addline(dg.getAddress());
form.addline(String.valueOf(dg.getData()[0]));
}
catch(Exception e)
{
System.out.print(e);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -