Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About alexus

  • Rank
  1. Hey all I need to add joystic support to my application (aircraft flight simulation program) but I have no idea how to do that in VB 2005. I heard it is doable via Direct Input. Can some one help me ot here? Tnx!
  2. Hey all, I have small project and i need some help. Basicaly I want to create cute interface for my Car PC. Regular VB limits me in what can do with animation and graphical outputs so I thought maybe I'll do something like game menu? Can some one tell me how can I easily build an animated menue. Also how I can import 3ds max file and do some animations with it? I know its like learning all new fild so maybe some useful straight to the point tutorials? I prefer to use VB2005 as my programing language. Thanks for help!
  3. being a dummy i did an very stupid mistake in my code... :-( I did listen for standelone port while I supose (I issume to listen to an assigned port) well fixed that byt still no luck... Here is the Nat state of my outer Source Port Destination Port Protocol Packets Bytes TTL 4265 5124 tcp 12 520 3:52 So i have sent socket from laptop and it reached the dectop. My router says that socket port is 4265 but when I send packet on that port i got nothing... i even recomplile my app and im setting the the port manually to what the router says, caz for some reason my PP GIVES ME WRON PORT %) i will atach the code of my app in edit... gota swich to dectop Edit: Heere we go with the source code: Listener: Imports System.net Public Class Form1 Private _ClientSocket As Sockets.Socket Private _HostSocket As Sockets.Socket Friend _TcpListener As New Sockets.TcpListener(Dns.GetHostEntry(Dns.GetHostName).AddressList(0), 5124) Private Sub btnListen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnListen.Click CType(_TcpListener.LocalEndpoint, IPEndPoint).Port = txtPort.Text txtSetPort.Text = CType(_TcpListener.LocalEndpoint, IPEndPoint).Port.ToString Timer.Enabled = True Timer.Start() End Sub Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick Try _TcpListener.Start() Catch ex As Exception MessageBox.Show(ex.ToString) End Try If _TcpListener.Pending = True Then _HostSocket = _TcpListener.AcceptSocket If _HostSocket.Poll(1, Sockets.SelectMode.SelectRead) Then Dim numBytes As Int32 = _HostSocket.Available Dim Data(numBytes) As Byte _HostSocket.Receive(Data) HostMessagesReceivedTextBox.Text &= System.Text.ASCIIEncoding.ASCII.GetString(Data) HostMessagesReceivedTextBox.Text &= ControlChars.CrLf 'Timer Stop End If Else 'MessageBox.Show("I dont want the conectiosn, the status is not PENDING") End If End Sub Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click Timer.Stop() Timer.Enabled = False Try _TcpListener.Stop() Catch ex As Exception End Try txtSetPort.Text = "" End Sub End Class And here is how i get port numbers that are displayed incorectly ReplyIP = IPAddress.Parse(CType(_HostSocket.RemoteEndPoint, IPEndPoint).Address.ToString) ReplyPort = IPAddress.Parse(CType(_HostSocket.RemoteEndPoint, IPEndPoint).Port.ToString)
  4. whats "htons()"? Your diagram is what i have! Also just tried to open firewall but that didnt help. Here is diagram of what i have with my IPs: Internet < - -> [NAT Router A] | [NAT Router B] < - -> [Your Desktop] | [Your Laptop]
  5. Ok i did some testings and it dosnt make any sense for me... Here are my observations: My Setup: Laptop w. IP is behind a NAT device which in not UPnP. Desctop is not on the nated subnet and is "before" the router, its IP is 192.168.101 and it functions as the server for me to find out the port of laptop to send back the socket in that was that I dont need to configure the routher. Oh router IP (Will consider this as WAN address) Finally defult port for my app is 5124 So... 1) Laptop send to - same app says recived from Sending socket to => Got error no such host or EndPoint not ready 2)Latop sending to Desctop to ... on desctop recived from 3) Desktop sending to Laptop on just recived port # to => No host, ok fine 4) Repeating step 3 but with standard port to => No Host Conclusion: Dosnt work! What can I do here? Put my Laptop into DMZ?
  6. ok, i found the error in my code so now i am getting the real remote port BUT when im sending back something to that port i'm getting errro saying host no ready or dosnt accept the the packats. Why that? Could that be due to TCP or soemthing else?
  7. did read that... i will post my code when i get to my main pc
  8. ok yes thats what i assume and the way most packets work that it should have return adress stated rather then general assumed address. But my knowlage of socket calss in VB is like 1% i just found about it last week, and i have no experiance in network programing (thats if we exclude DB apps which are not really network programing) As to C++ Extress Edition I didntk now it exist, but even if i download it, i will feal like im lost, i havent seen the C code for years... Oh yea could it be that VB cant read the masked port #?
  9. :-( I dont have C compiler, im running VB Epress Edition I juess there is no vb implementation because VB socket class returns the port # that is original one and not the one that router assigned :-( Is it possible to compile your C code to a dll and use it as service file to just get the addresses? I havent used C since version 4 im even efraid to edit it when I get my compiler installed
  10. Hi, Ok I searched every where and cant reaaly find the code for nat punch, only the theory! Does any one knows how to do this in VB. net (2005)? im using System.Sockets class Thanks!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!