Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
actually i have develop the network project in winforms.

my problem is socket error in one form(router form) that socket error like


"system.argumentNullException:value can not be null.
parameter name:buffer
at system.Net.Sockets.socket.Send(Byte[]buffer,int32 offset,int32size,SocketFlags socketFlags,SocketError&errorCode)
at system.Net.Sockets.socket.Send(Byte[]buffer,int32 offset,int32size,SocketFlags socketFlags)
at system.Net.Sockets.socket.Send(Byte[]buffer)
at simulation.routers.send()in c:\Documentandsettings\Adminstrator\desktop\sourcecode\routers\router.cs:line 51"

socket error occur in send method like as

C#
private void Send()
        {
            try
            {
                IPAddress[] ipAddress = Dns.GetHostAddresses(textBox1.Text);
                IPEndPoint ipEnd = new IPEndPoint(ipAddress[0], 5656);
                Socket clientSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);

                clientSock.Connect(ipEnd);
                clientSock.Send(ReceiverCode.send);
                clientSock.Close();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }


in this method contain error statement

C#
clientSock.Send(ReceiverCode.send);


this project had completed using wireless network(wi-fi)on yesterday.

but today morning my wifi not working then i have run the project using another wifi and local

area connection but still my project have socket error

pls help me
Posted
Comments
ashok rathod 19-Sep-14 6:11am    
what is ReceiverCode.send in your case ? as it seems that on your communication you are semding nothing or other problem might be that you are not able to connect to your new wi-fi network properly . what i would suggest is try connectivity using tracert or ping utility .
Richard MacCutchan 19-Sep-14 10:13am    
The message is telling you what is wrong, and even which parameter is null.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900