跳到主要內容

websocket client實作

技術分享會我們將做的幾件事
1. 用自己的暱稱登入(t2.html)
2. 發佈一則廣播訊息(t2.html)
3. 發佈一則私有訊息(t2.html)
4. 發佈一個資訊到 加法器 (自行實做t3.html)
發送{"c":"Pmag","p":"add 1 2"}
得到{"c":"Pmag","r":"3"}

我們有一個目標 ,要讓完全沒寫過 javascript但使用過其它程式語言的夥
伴,來體驗寫一個簡單的websocket應用

   

留言

這個網誌中的熱門文章

3分鐘學會使用程式發送msn訊息,php篇(一)

---電子發票整合方案 http:// rd-program.blogspot.com/ 2012/03/blog-post.html --- < imoo msn機器人測試平台,將於下週三(2009.6.24)取消所有未經申請試用的認證資訊 , 詳見相關資訊 > msnSDK訊息控制開發套件 同時支援MSN/Yahoo即時通 訊息雙向傳遞 ps.也請參考 msnSDK的使用流程 ================================ 步驟一:取得api 使用的權限(GETSPID) $file="http://59.120.234.84:8082/msnSDK/msn_cgi-win32?FUNC=GETSPID&USERID=apiblogt1&PASSWD=msnsdkt" ; $myArray=''; $mySession=''; $myResult=''; $getline=''; if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } while ($getline = fgets($fp, 4096)) { $myArray=explode("\t",$getline); $myResult=$myArray[0]; $mySession= $myArray[1]; } fclose($fp); if ($myResult=="0") { echo "get session fail... "; exit(); } else { //$_SESSION["mySession"]= $mySession; echo "get session=".$mySession." "; } echo "<a href='REGISTER.php?uids=".$_GET["uids...

3分鐘學會使用程式發送msn訊息, Java篇(三)

< imoo msn機器人測試平台,將於下週三(2009.6.24)取消所有未經申請試用的認證資訊 , 詳見相關資訊 > msnSDK訊息控制開發套件 同時支援MSN/Yahoo即時通 訊息雙向傳遞 ps.也請參考 msnSDK的使用流程 ================================ public class clsMsnSDK { public static void main(String[] args) throws Exception { String UserName = "apiblogt3"; String Password = "msnsdkt"; //取得SPID String strRet = GETSPID(UserName,Password); String[]tmp = strRet.split("1\t"); String strValue = tmp[1].replace('\n',' ').trim(); String SPID = strValue; System.out.println(SPID); //註冊聯絡人 String Email = "xxxxx@hotmail.com"; //填入msn/yahoo聯絡人,勿使用這個預設值 String ret = Register(Email,SPID); System.out.println(ret); //發訊息 String strMsg = "Hello_World!"; //輸入訊息 (未做 Url EnCoded) String MsgRet = SendMsg(Email,strMsg,SPID); System.out.println(MsgRet); } //取得SPID public static String GETSPID(String UserName,String Password) throws Exception { String strUrl = "http://59.120.2...