JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java ME、Google Android 平台與 JavaCard 討論區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 請問 SocketConnection
cowbjt





發文: 38
積分: 0
於 2005-01-28 10:32 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我在用SocketConnection 的時候
compile 會過都沒問題
但執行的時候卻顯示
1
警告: 為避免潛在的鎖死,您必須在與

然後就當在這了
但訊息就只有這樣也沒寫完,所以不知道怎麼修改

造成這樣的程式是
1
SocketConnection sCon = (SocketConnection)Connector.open("socket://xxx.xxx.xxx.xxx: xxxx ");


我的設計,一開始有一個主畫面,利用選項進來這一個socket的頁面
而如果我把連socket的頁面放在一開始就執行就很正常
但如果是由主畫面再進socket頁面就會這樣,真是怪了


cowbjt edited on 2005-01-28 10:36
reply to postreply to post
作者 Re:請問 SocketConnection [Re:cowbjt]
mslin





發文: 183
積分: 0
於 2005-01-28 19:26 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
請用Thread 摟~~~

reply to postreply to post
作者 Re:請問 SocketConnection [Re:cowbjt]
cowbjt





發文: 38
積分: 0
於 2005-02-01 11:47 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
果然,真是感謝了

請問在j2me裡
socket 一定要寫在thread 裡嗎


reply to postreply to post
作者 Re:請問 SocketConnection [Re:cowbjt]
atticcat

There is no cookie



發文: 702
積分: 4
於 2005-02-02 10:00 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
cowbjt wrote:
果然,真是感謝了

請問在j2me裡
socket 一定要寫在thread 裡嗎

基本上..
Connector跟Manager..
我都會用Thread來作..
印像中好像也是要這樣子吧~~


reply to postreply to post
作者 Re:請問 SocketConnection [Re:mslin]
jeffochen





發文: 1
積分: 0
於 2005-05-19 00:48 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
你要把你對 Socket (或是HttpConnection) 的連線起始寫在 Thread.run() 方法裡便可以避免鎖死的狀況發生了

reply to postreply to post
作者 Re:請問 SocketConnection [Re:atticcat]
星際遊俠





發文: 1
積分: 0
於 2006-03-31 10:58 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看個人適用的需求來決定吧...........
Socket不一定要寫再Thread內..........
我的Socket就沒有寫再Thread內...也可以順利的執行


reply to postreply to post
作者 Re:請問 SocketConnection [Re:cowbjt]
jc





發文: 62
積分: 0
於 2006-03-31 11:46 user profilesend a private message to usersend email to jcreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
記得是MIDP2.0之後
想要透過http或socket網路連線等動作~最好還是都寫在Thread裡面
模擬器也有類似waring的提示訊息之檢查機制~以避免手機程式dead lock的機率~


reply to postreply to post
作者 Re:請問 SocketConnection [Re:cowbjt]
ganenew





發文: 70
積分: 0
於 2006-05-08 02:25 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
如果是寫在thread裡 請問要怎寫

因為小弟第一次碰J2ME 囧'


reply to postreply to post
» JWorld@TW »  Java ME、Google Android 平台與 JavaCard 討論區

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8