Hatena::Groupwindowsmobile-dev

伊勢的WM

 | 

10/03/11 (Thu)

.NET Compact Framework の Socket で SSL をつかう

01:31

.NET FrameworkSSL を使ったソケット通信をするときは NetworkStream を SslStream にラップして使うのが一般的なのですが、.NET Compact Framework にはいつものようにこのクラスが存在しません。

そこで利用できるのがこのサンプルにあるSslHelperというクラス。

Enable SSL for managed socket on windows mobile – Random.Next()

SslHelperを使うと初期化したソケットをSslHelperのコンストラクタに指定して呼び出すだけでSSL接続になります。

Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
SslHelper sslHelper = new SslHelper(socket , Server.Name);
IAsyncCallback ar = m_socket .BeginConnect(server.GetEndPoint(), new AsyncCallback(OnConnected), socket);

ただ、注意しないといけない点があって、受信待機で NetworkStream.DetaAvaliable や Socket.Available だけでデータを確認している場合は受信データがいつまでたってもこない状態になってしまいます。Socket.Pollを使いましょう。

socket.Poll(100, SelectMode.SelectRead);

PierinaPierina 2012/08/21 19:57 Of the panpoly of website I've pored over this has the most veracity.

iubwilkpiubwilkp 2012/08/22 13:24 jipGxS <a href="http://xvqfwqefgmjm.com/">xvqfwqefgmjm</a>

chcfpdhichcfpdhi 2012/08/23 22:33 vOsS7F , [url=http://wpbcwfviojxi.com/]wpbcwfviojxi[/url], [link=http://lxmshchwjqke.com/]lxmshchwjqke[/link], http://czcevlgrrnqu.com/

gibtusgibtus 2012/08/24 19:57 cmedbP <a href="http://vayzhdmandqp.com/">vayzhdmandqp</a>

jwffvkijwffvki 2012/08/25 02:28 hkdDon , [url=http://vdehjpwyyurf.com/]vdehjpwyyurf[/url], [link=http://dwjpieznodti.com/]dwjpieznodti[/link], http://isxvumsorfaa.com/

KevinExopeKevinExope 2018/09/08 10:50 Sexual relationship is often a pleasurable give to get relationship with one?s partner. If anything goes wrong with this give to get process, it really is enough to derail the connection. But whatever could happen and that is unpredictable. Moreover, able to keep a healthy sexual relationship means keeping oneself physically healthy. So any type of sexual disfunction must be treated with utmost care. One such health hazard is erectile dysfunction commonly present in men. Unable to keep a proper and prolonged penile erection results in impotence problems. This is infact a significant problem for maintaining a normal sexual relationship. So when there arises this type of problem it?s smart to treat it in lieu of sitting quiet.

The choice relating to the various available treatment options involve treatment which has a proper medicine. Response to a verbal agent for example Levitra can be very effective with this context. Studies show that erectile dysfunction is especially as a result of insufficient blood circulation on the penis? veins and lack of stimulation at the same time. Practising oral therapy of Levitra increases the rate of blood flow that gradually stimulates the penis resulting in a hard erection, adequate on an intercourse.



Levitra is but one such drug that is seen to be effective. Clinically it is often proved who's even conditions patients that are suffering from various health conditions like hypertension, high cholesterol levels or diabetes. A lot of men, who took Levitra the very first time, responded positively for gaining high success rate. Besides, it is often also found who's can be also taken with medicines used to treat other health conditions.

<a href="https://www.cialispascherfr24.com/tadalafil-prix-france-quebec/">https://www.cialispascherfr24.com/tadalafil-prix-france-quebec/</a>

ゲスト



 |