저급 네트워킹 코드를 직접 작성하는 것을 방해하는 것은 없지만, 라이브러리를 사용하면 많은 시간을 절약 할 수 있습니다. 그리고 스트레스, 당신이 더 나은 자신의 응용 프로그램을 향상 지출 할 수있는 시간.
여기에 언급되지 않은 라이브러리는 networkComms.net입니다. 직렬화, 압축 및 암호화와 같은 정교한 기능이 많이 있지만, 연결 수를 언급하면 1Gbps +의 전송 속도로 1000+ 연결을 처리 할 수 있습니다. how to create a quick client server application에 간단한 기사가 있지만 요약하면 다음과 같이 보내고받을 수 있습니다.
을 보내려면
//This is the simplest way to send with more advanced options also available
//Parameters are message type, IP address, port and the object to send
NetworkComms.SendObject("Message", "127.0.0.1", 10000, "Networking in one line!")
수신하려면
//We need to define what happens when packets are received.
//To do this we add an incoming packet handler for
//a 'Message' packet type.
//
//This handler will automatically convert the incoming raw bytes into a string
//(this is what the <string> bit does) and then write that string to the
//local console window.
NetworkComms.AppendGlobalIncomingPacketHandler<string>("Message", (packetHeader, connection, incomingString) => { Console.WriteLine("\n ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'."); });
//Start listening for incoming 'TCP' connections. The true
//parameter means try to use the default port and if that
//fails just choose a random port.
//See also UDPConnection.StartListening()
TCPConnection.StartListening(true);
면책 조항 :이 라이브러리의 개발자 중 하나입니다.
라이브러리가 VB.NET으로 작성된 것이 맞습니까? –
@ John Saunders : 라이브러리가 컴파일 된 경우 a.Net 어셈블리는 CIL로되어 있으므로 소스 언어가 무엇인지는 중요하지 않습니다. –
@Callum : 고마워, 알아. Mark에게 "C# 네트워크 라이브러리"를 요청한 이후로 물었습니다. –