Home Forums Support Transfer of how a simple class?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #3330

    I’ve confirmed the sample.
    C # sample is difficult for me.

    Can you provide a more simple sample?
    I vb.net user.

    How do I transfer to a remote location to my CLASS object?

    Please provide me a sample

    I simply my CLASS with the data sent to the remote and
    I would like to restore the value


    There is a VB.net sample included in the download package, have you seen this?



    I check the sample.

    It sent a string that receives the console

                                            CType(targetServerConnectionInfo.RemoteEndPoint, IPEndPoint).Address.ToString(),
                                            CType(targetServerConnectionInfo.RemoteEndPoint, IPEndPoint).Port,

    I want to get my class to send a simple object.
    Using VB.net

    I created a simple source
    But it does not work.
    (An error occurred)

    here my code

    my class..

    <ProtoContract> _
    Public Class ProtobufCustomObject
        <ProtoMember(1)> _
        Public Property IntValue() As Integer
                Return m_IntValue
            End Get
            Private Set(value As Integer)
                m_IntValue = value
            End Set
        End Property
        Private m_IntValue As Integer
        <ProtoMember(2)> _
        Public Property StringValue() As String
                Return m_StringValue
            End Get
            Private Set(value As String)
                m_StringValue = value
            End Set
        End Property
        Private m_StringValue As String
        ''' <summary>
        ''' Private constructor required for protobuf
        ''' </summary>
        Private Sub New()
        End Sub
        ''' <summary>
        ''' Constructor object for ProtobufCustomObject
        ''' </summary>
        ''' <param name="intValue"></param>
        ''' <param name="stringValue"></param>
        Public Sub New(intValue As Integer, stringValue As String)
            Me.IntValue = intValue
            Me.StringValue = stringValue
        End Sub
    End Class

    Sending. Side.
    Form LOAD
    NetworkComms.AppendGlobalIncomingPacketHandler(Of Byte())(“ArrayByte”, AddressOf PrintIncomingMessage)
    NetworkComms.AppendGlobalIncomingPacketHandler(Of String())(“ArrayString”, AddressOf PrintIncomingMessage2)
    NetworkComms.AppendGlobalIncomingPacketHandler(Of ProtobufCustomObject)(“CustomObject”, AddressOf 수신객체)

    ‘ Connection.StartListening(ConnectionType.TCP, New IPEndPoint(IPAddress.Any, 2020), False)

    Connection.StartListening(컨넥션타입, New IPEndPoint(IPAddress.Any, 0))

    Dim localListeningEndPoints As List(Of EndPoint) = Connection.ExistingLocalListenEndPoints(컨넥션타입)
    For Each localEndPoint As IPEndPoint In localListeningEndPoints

    Debug.WriteLine(“서버2 {0}:{1}”, localEndPoint.Address, localEndPoint.Port)

    Send Command button

            Dim lastServerIPEndPoint As IPEndPoint = Nothing
            lastServerIPEndPoint = IPTools.ParseEndPointFromString(Me.TextBox1.Text)
            Dim appl As ApplicationLayerProtocolStatus = ApplicationLayerProtocolStatus.Enabled
            Dim ConnectionInfo As ConnectionInfo = New ConnectionInfo(lastServerIPEndPoint, appl)
            Dim connectionToUse As Connection = TCPConnection.GetConnection(ConnectionInfo)
            Dim kkk As ProtobufCustomObject = New ProtobufCustomObject(1111, "2222")
            connectionToUse.SendObject("CustomObject", kkk)

    err messge…from ExplicitSerializer class..

    처리되지 않은 ‘System.ArgumentException’ 형식의 예외가 NetworkCommsDotNet.dll에서 발생했습니다.
    추가 정보: objectToSerialize must implement IExplicitlySerialize

    Please provide me a simple VB.net samples

    It is a simple string, my custom class objects, including a number

    It is the server and the client of the window-based
    Samples for transmitting and receiving.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.