How to use setSoLinger of Socket class

F

Florent Coué

Hello,

How to be sure that all the data written on the output of a Socket are
really sent after the close of the socket ?
I've seen that it exists a method setSoLinger() who allows to set a delay
before the socket is closed. I tried it but it does nothing. The last data
that I send are thrown away when the socket is closed.
Has the method setSoLinger() the same effect that a sleep() before closing
socket ?

Thanks for help.

Florent
 
X

xarax

Florent Coué said:
Hello,

How to be sure that all the data written on the output of a Socket are
really sent after the close of the socket ?
I've seen that it exists a method setSoLinger() who allows to set a delay
before the socket is closed. I tried it but it does nothing. The last data
that I send are thrown away when the socket is closed.
Has the method setSoLinger() the same effect that a sleep() before closing
socket ?

Thanks for help.

Florent

Are you calling socket.shutdownInput() and socket.shutdownOutput()
before calling socket.close()?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top