sockets - I want to send some data and image when client send request to server in c# using TCP/IP -
i new in socket programming. did simple message transfer 1 process another, want send image + data when client sends request server. able send data or image, not both of them in single request. how accomplish this?.
as mentioned in comments, in context of tcp/ip sending \ receiving process based on streaming array of bytes. can use following algorithm (it not copy-paste solution) :
- create custom type contains data : may string , i recommend store path string origin image.
class streamdata {string datapath {get;set;} string imagepath {get;set;} }
- add abstraction level class convert data (image, music) byte array , path of data convert.
class streamconverter{ //some awesome method(string path)}
.
and send data client. don't forget how client deserialize/encode data.
Comments
Post a Comment