Solution: create socket in the same thread where it is used
Attach a file by drag & drop or click to upload