Problem in File transfer through C#

  • Thread starter Thread starter Siddharth
  • Start date Start date
S

Siddharth

Hello friends,
I am having a problem in transferring a file from a client to
another client via a server, with the help of SOCKETS. I am using NETWORK
STREAM to tranfer the file contents. As soon as the file is sended to the
SERVER's SOCKET, it shows an error of : "CONNECTION FORCIBLY CLOSED". Please
help me out. I need to submit it as a FINAL YEAR PROJECT, in my INSTANT
MESSENGER.
 
Hello, Siddharth!

S> Hello friends,
S> I am having a problem in transferring a file from a client to
S> another client via a server, with the help of SOCKETS. I am using
S> NETWORK STREAM to tranfer the file contents. As soon as the file is
S> sended to the SERVER's SOCKET, it shows an error of : "CONNECTION
S> FORCIBLY CLOSED". Please help me out. I need to submit it as a FINAL
S> YEAR PROJECT, in my INSTANT MESSENGER.

Maybe server expects the data in special format defined by the protocol?
Do you use any application protocol for file sending?

If you use .NET 2.0 you can use Socket.SendFile method

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Vadym said:
Hello, Siddharth!

S> Hello friends,
S> I am having a problem in transferring a file from a client to
S> another client via a server, with the help of SOCKETS. I am using
S> NETWORK STREAM to tranfer the file contents. As soon as the file is
S> sended to the SERVER's SOCKET, it shows an error of : "CONNECTION
S> FORCIBLY CLOSED". Please help me out. I need to submit it as a FINAL
S> YEAR PROJECT, in my INSTANT MESSENGER.

Maybe server expects the data in special format defined by the protocol?
Do you use any application protocol for file sending?

If you use .NET 2.0 you can use Socket.SendFile method


Thanks for the concern in my problem. I am using .NET 1.1 and I wanted to get
a solution which is compatible in this version. I would be obliged if you can
help me out.

I am developing an Instant messenger in C#. I have developed the Text
Messenger in the form of two different applications for : Client and the
Server. I wanted to add the facility of Voice and Video Chatting to it. I
have developed a separate application for Capturing the Voice and Video
through a Microphone and a Web Camera that saves it as a file.
I wanted to integrate this application into the Client App. to incorporate
the facility of Voice transfer in the form of a File.
The problem that I am facing is that, As soon as I transfer the file in the
form of NETWORK STREAM, it throws an exception that "CONNECTION FORCIBLY
CLOSED". I would be highly Obliged if I get this problem solved.
 
Hello, Siddharth!

If you have the access to Server code then you can change its behavior not to close connection. How server determines that a file is being send to it?

Also I would recommend instead of saving info to the file and then sending, you can send retrieved visual and sound data at once ( on the fly ).

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Back
Top