sockets - C# Service Receiver Program Crashes -
hi doing socket programming. when data socket, program works program way remain stuck when data come. not understand why happening. "server.receiver" part gets stuck , program crashes. in addition, doesn't prompt error.
c# code
application.doevents(); string gelenveri = ""; system.net.sockets.udpclient server = new system.net.sockets.udpclient(convert.toint32(port)); ipendpoint sender = new ipendpoint(ipaddress.parse(ip), 0); byte[] data = new byte[1024]; data = server.receive(ref sender); server.close(); gelenveri = (encoding.ascii.getstring(data, 0, data.length));
use ipendpoint(ipaddress.parse(ip), port) instead of ipendpoint(ipaddress.parse(ip), 0)
Comments
Post a Comment