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) :

  1. create custom type contains data : may string , i recommend store path string origin image.

class streamdata {string datapath {get;set;} string imagepath {get;set;} }

  1. 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

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -