Home > Net >  WebSocket send files the way and the process (c #)
WebSocket send files the way and the process (c #)

Time:05-22

I want to use c # System.Net.WebSockets.WebSocket for file transfer,
But don't know the file transfer process how to do better,

I will notify the other party is required to XXX files, then the file again, and then provide the custom at the end of the command to inform each other I have finished the file?


The idea is...
There are three kinds of WebSocketMessageType type: Text, Binary, Close,
First send WebSocketMessageType. The JSON content of type Text, tell each other what is next to the file and the file name,
Then send WebSocketMessageType. Binary types of files in the past,
Then pass WebSocketMessageType. The Text type of JSON content, inform the other party a file transfer has been finished,

Bother you guidance, thank you,

CodePudding user response:

This problem a lot recently,
But first we have to ask one thing, the relationship between the two points, you
The client and the server can do directly,
The client and the client need to sever forward

So I didn't continue to determine this, the first around or you are not the same point

CodePudding user response:

Open source is simple and easy to use https://github.com/sta/websocket-sharp
Use the sample
http://bbs.cskin.net/thread-18391-1-1.html

CodePudding user response:

reference 1st floor wanghui0380 response:
this problem a lot recently,
But first we have to ask one thing, the relationship between the two points, you
The client and the server can do directly,
The client and the client need to sever forward

So I didn't continue to determine this, the first around or you are not the same point
this action is WebAPI, after receipt of the files by the WebSocket Server notify the specific WebSocket Client (if the WebSocket Client on the connection)
  •  Tags:  
  • C#
  • Related