Skip to content

Instantly share code, notes, and snippets.

@tututen
Created July 15, 2014 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tututen/c8a56c37ea7112a3351f to your computer and use it in GitHub Desktop.
Save tututen/c8a56c37ea7112a3351f to your computer and use it in GitHub Desktop.
C#で指定した送信元IPを使って通信行う場合
var socket = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork,
System.Net.Sockets.SocketType.Dgram,
System.Net.Sockets.ProtocolType.Udp);
socket.Bind(new System.Net.Sockets.IPEndPoint(System.Net.IPAddress.Parse("192.168.0.4"), 0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment