i want to build a chat application which supports text messaging, group messaging, file transfer(like netmeeting). when i send it over TCP socket i saw that data is not structured all the data send as string over TCP. I want to send it in a structured way with few headers like name:,ip:,data:,data_type_flag:(file or text message) etc... one stackoverflow member told me to use TELEPATHY but i can't get a simple tutorial to understand. how can i send structured data over socket? or can any one suggest me a good tutorial to implement telepathy properly. i want to communicate over network as peer-to-peer rather than dedicated server.. Thanks
解决方案
Try google protcol buffers or apache thrift. There are many examples for how to use them.
As for your comment about "peer to peer", please realize that even in peer-to-peer one of the peers is always acting as a server (sometimes both are).
                  
                  
                  
                  
博主想构建支持文本、群组消息和文件传输的聊天应用,通过TCP套接字发送数据时发现数据无结构,希望以带特定头部的结构化方式发送。有人建议用TELEPATHY但无简单教程,解决方案是尝试Google Protocol Buffers或Apache Thrift,还指出即使点对点通信也总有一方充当服务器。
          
      
          
                
                
                
                
              
                
                
                
                
                
              
                
                
              
            
                  
					8259
					
被折叠的  条评论
		 为什么被折叠?
		 
		 
		
    
  
    
  
            


            