Questions tagged [system.net.sockets]

65 questions
2
votes
1 answer

How to send data form Windows Phone 8.1 to PC using TCP or UDP?

I'm trying to send data between Windows Phone 8.1 app and my PC. How to do this? Is there any other way to connect with my PC? I found this. But I can't add System.Net.Sockets to my project. Any working example will be a huge help.
2
votes
1 answer

Cannot determine the cause of System.ObjectDisposedException during application shutdown

I am stuck in a debugging scenario and I need help understanding how I might get more information about what is happening to my application. The exception is thrown when I close the main form, seemingly during the last bit of processing prior to…
DonBoitnott
  • 10,787
  • 6
  • 49
  • 68
2
votes
0 answers

Receiving None Standard Layer 2 Packets in .NET

I'm trying to receive Layer 2 packets in .NET. I've tried to use Sockets in RAW mode with no avail. Example WireShark Packet: 0000 ff ff ff ff ff ff 00 b0 d0 04 82 ae 12 fd bb 00 ................ 0010 01 1c 00 02 00 b0 d0 04 82 ae 01 af af…
1
vote
2 answers

How to Create a TCP Client connection with a Client Certificate in Powershell

With Following code i can establish a SSL Connection: $cert = dir cert:\CurrentUser\My | where {$_.Subject -like "*Alice*"} $computerName = "google.com" $port = "443" $socket = New-Object Net.Sockets.TcpClient($computerName, $port) …
icnivad
  • 2,231
  • 8
  • 29
  • 35
1
vote
1 answer

Delay when displaying a message received by a Telnet client

I am trying to implement a Telnet client in VB.NET. I am following this code as example: The program I'm implementing works as follows: I click the button "Open Telnet" to open the Telnet session. I write an instruction (string) in the text box on…
Marco
  • 391
  • 4
  • 18
1
vote
1 answer

Unable to find the reference to code example on microsoft docs

I'm going through the example code in https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socketasynceventargs?redirectedfrom=MSDN&view=netframework-4.8 to understand it and get it working, however when i copied it over to try it out,…
1
vote
2 answers

SocketException 'the connected party did not properly respond after a period of time' when connecting to server using public ip (C#)

I'm trying to create a server using C#. Currently, I have two programs, a server and a client both of which work correctly when they are both run on the same computer, the server's TcpListener is created using the ip 127.0.0.1 (localhost) and the…
1
vote
0 answers

Is it necessary or recommended to make a UDP send-only socket async?

I am using a UDP socket to send eventlog data to a log analysis server, and don't want to block threads unnecessarily. The sending application is a Windows background service using a default threadpool. // Should this be async? It's UDP only... …
Ran Dom
  • 315
  • 5
  • 13
1
vote
0 answers

How can I send List< string[] > using NetworkComms.Net

There is a server and a client. I am trying to send a list of string arrays (List< string[] >) from the server to the client. I want to learn how to correctly serialise such an object. So far I have the following: Server side: …
Nanyo
  • 87
  • 1
  • 10
1
vote
0 answers

ETW Manifest files - finding more information on the values?

I'm troubleshooting the windows Networking stack and using Perfview/ETW to do it. I'm particularly interested in some values that appear in the manifest for the event source Microsoft-Windows-TCPIP. I can get the manifest with no problem using…
g0pher
  • 59
  • 8
1
vote
1 answer

ExtendedSocketException encountered when calling TcpClient.ConnectAsync() from a UWP app

When calling TcpClient.ConnectAsync(), a ExtendedSocketException is encountered with the message "An attempt was made to access a socket in a way forbidden by its access permissions". However, connecting to the same TCP endpoint with a regular .NET…
BCA
  • 7,776
  • 3
  • 38
  • 53
1
vote
1 answer

System.Net.Sockets exception on IOControl

On windows 7 (.Net 4.6.1) I am getting exception with this code: var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.IOControl(-1744830448, new byte[4] { 1, 0, 0, 0 }, null); The attempted…
user007
  • 1,122
  • 1
  • 10
  • 30
1
vote
1 answer

Socket.SendFile send big file error 87

I use the standard method of sending a file. internal bool SendToServer(string filename) { if (null == _netSocket || !_netSocket.Connected) CreateSocketConnect(); try { _netSocket.SendFile(filename); …
1
vote
1 answer

Is the usage of TcpClients in unity3d for android possible?

I am trying to make an andorid app that commuicates with my server via Unity 5.4. The Devices need to be in the same network to do so. For that i am using System.Net.Sockets and a TcpClient to connect to my server. Everything works well when i run…
1
vote
0 answers

Partial Send in Socket.BeginSend( List )?

I have a question regarding the System.Net.Socket.BeginSend method. public IAsyncResult BeginSend( IList> buffers, SocketFlags socketFlags, AsyncCallback callback, object state ) If SocketFlags.None is indicated…
Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97