使用套接字发送对象 [英] Sending a Object using sockets

查看:102
本文介绍了使用套接字发送对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我的问题是如何将对象从一个套接字发送到另一个套接字.我知道我们如何发送字符串.

Hi there. My question is how do we send a object from one socket to another socket. I know how do we send strings. Thanks for who reply!!

推荐答案

基本上是相同的过程,最后,您将对象转换为字节数组,并通过套接字发送,然后在接收端将其从字节数组转换回对象.

您可以在此处找到更多详细信息 [
It''s basically the same process, at one end you convert your object to a byte array, and send that across the socket, and at the receiving end you convert it from a byte array back to an object.

You can find more detailed information here[^].


对Richard的答案的一个较小的更正:最好使用更多实际的链接,例如这样的:
A minor correction to the Answer by Richard: better use more actual link, like this one: http://msdn.microsoft.com/en-us/library/7ay27kt9(v=VS.100).aspx[^].

—SA


这篇关于使用套接字发送对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆