Andrew Simpson
Andrew Simpson

Reputation: 7314

Optimise a TCP connection as similar to a UDP connection using Socket.IOControl

Currently I am using Udp to send small images to my server. This methodology is quick as it works as a 'fire and forget' mechanism. Meaning that the server does not care if the Udp packet sent by the client has been received or not.

I had tried before using Tcp to do the same thing and the Fps is slow in comparison to Udp. One of the reasons is that the Tcp end point on the server will always send an ack back to the client.

Out of interest I wanted to see if I can disable this 'call back' to see what the comparison performance would be.

I cam across socket iocontrol where I can see I can set low level settings to the binding connection. One of these is the keep alive values which can be set passing the IOControlCode.KeepAliveValues parameter with the preferred values for it.

I did look at what is available but could not see an obvious 'disable ack' parameter. I can see AsyncIO and NonBlockingIO. Would either of these stop the 'ack' being sent back or is it another parameter entirely?

Upvotes: 0

Views: 87

Answers (1)

Rowan Smith
Rowan Smith

Reputation: 2180

You can't turn off TCP ACK. There is no reason why you can't use TCP to send full frame video (think Netflix).

You just need to use appropriately sized send and receive buffers so that you're not waiting. You don't need to use IOControl to modify these, you can set them directly on the Socket.

Upvotes: 1

Related Questions