摘要: ConclusionAnd that's all there is to it! Here is how our client looks likeHere is how our server looks likeThat is all there is to the socket programming. 阅读全文
posted @ 2013-09-10 17:46 朱煜 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Server SideIf you have understood whatever I have described so far, you will easily understand the Server part of the socket application. So far we have been talking about a client making connection to a server and sending and receiving data.On the Server end, the application has to send and receive 阅读全文
posted @ 2013-09-10 17:45 朱煜 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Now lets say you have two sockets connecting to either two different servers or same server (which is perfectly valid) . One way is to create two different delegates and attach a different delegate to different BeginReceive function. What if you have 3 sockets or for that matter n sockets , this app 阅读全文
posted @ 2013-09-10 17:44 朱煜 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Getting StartedYou can argue that one can overcome these shortcomings by multithreading meaning that one can spawn a new thread and let that thread do the polling which then notifies the main thread of the data. This concept could work well, but even if you create a new thread it would require your 阅读全文
posted @ 2013-09-10 17:42 朱煜 阅读(320) 评论(0) 推荐(0) 编辑
摘要: This is the second part of the previous article about the socket programming. In the earlier article we created a client but that client used to make blocking IO calls ( Receive ) to read data at regular intervals (via clicking the Rx button). But as I said in my earlier article, that model does not 阅读全文
posted @ 2013-09-10 17:41 朱煜 阅读(277) 评论(0) 推荐(0) 编辑