Click here to Skip to main content
15,887,596 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Reading sectors Pin
Eddy Vluggen1-Aug-09 0:18
professionalEddy Vluggen1-Aug-09 0:18 
QuestionHow can made safer application that is not detect by antivirus? Pin
Le@rner31-Jul-09 21:04
Le@rner31-Jul-09 21:04 
AnswerRe: How can made safer application that is not detect by antivirus? Pin
Eddy Vluggen1-Aug-09 0:25
professionalEddy Vluggen1-Aug-09 0:25 
AnswerRe: How can made safer application that is not detect by antivirus? Pin
Dave Kreskowiak1-Aug-09 4:50
mveDave Kreskowiak1-Aug-09 4:50 
QuestionOutlook Addin Loading Error [modified]nks Pin
dcdhingra31-Jul-09 20:37
dcdhingra31-Jul-09 20:37 
AnswerRe: Outlook Addin Loading Error [modified]nks Pin
Dave Kreskowiak1-Aug-09 4:47
mveDave Kreskowiak1-Aug-09 4:47 
GeneralRe: Outlook Addin Loading Error [modified]nks Pin
dcdhingra1-Aug-09 16:37
dcdhingra1-Aug-09 16:37 
QuestionAsynchronous Socket Problem Pin
Nick Rioux31-Jul-09 16:12
Nick Rioux31-Jul-09 16:12 
I'm trying to implement something similar to this: Asynchronous socket communication[^]. However, I get an error "No connection could be made because the target machine actively refused it 127.0.0.1:4359" when EndConnect() is called.

Server
Public Sub Start()
    Dim EP As New IPEndPoint(IPAddress.Any, Me.Port)
    Dim listener As New Socket(EP.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
    listener.Bind(EP)
    listener.Listen(10)
    listener.BeginAccept(New AsyncCallback(AddressOf OnConnectRequest), listener)
End Sub

Private Sub OnConnectRequest(ByVal ar As IAsyncResult)
    Dim listener As Socket = DirectCast(ar.AsyncState, Socket)
    '(Adds connected client to a list)
    listener.BeginAccept(New AsyncCallback(AddressOf OnConnectRequest), listener)
End Sub


Client
Public Sub Connect(ByVal port As Integer)
    Dim sock As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
    Dim server As New IPEndPoint(IPAddress.Loopback, port)
    sock.BeginConnect(server, New AsyncCallback(AddressOf OnConnect), sock)
End Sub

Private Sub OnConnect(ByVal ar As IAsyncResult)
    Dim sock As Socket = DirectCast(ar.AsyncState, Socket)
    sock.EndConnect(ar) 'Exception is thrown here
    '(Handle connection)
End Sub


I ensure that the server is running before the client tries to connect and that the port is set correctly. I also don't think this is a firewall problem, as turning it off hasn't helped at all.

Can anyone help?


AnswerRe: Asynchronous Socket Problem Pin
Luc Pattyn31-Jul-09 18:47
sitebuilderLuc Pattyn31-Jul-09 18:47 
GeneralRe: Asynchronous Socket Problem Pin
Nick Rioux1-Aug-09 3:36
Nick Rioux1-Aug-09 3:36 
GeneralRe: Asynchronous Socket Problem Pin
Luc Pattyn1-Aug-09 7:03
sitebuilderLuc Pattyn1-Aug-09 7:03 
QuestionCode Project or a Blog? Pin
Martin Taylor31-Jul-09 11:59
Martin Taylor31-Jul-09 11:59 
AnswerRe: Code Project or a Blog? Pin
Christian Graus31-Jul-09 12:05
protectorChristian Graus31-Jul-09 12:05 
AnswerRe: Code Project or a Blog? Pin
Henry Minute31-Jul-09 12:17
Henry Minute31-Jul-09 12:17 
QuestionI Lost My Week End - Crystal Report vb.net 2008 Pls...Help !!! Pin
Paramu197331-Jul-09 8:11
Paramu197331-Jul-09 8:11 
AnswerRe: I Lost My Week End - Crystal Report vb.net 2008 Pls...Help !!! Pin
Kschuler31-Jul-09 10:00
Kschuler31-Jul-09 10:00 
AnswerLiteral in footer Pin
David Mujica1-Aug-09 4:33
David Mujica1-Aug-09 4:33 
QuestionClick once deployment error Pin
Member 254181430-Jul-09 23:12
Member 254181430-Jul-09 23:12 
AnswerRe: Click once deployment error Pin
Johan Hakkesteegt31-Jul-09 0:36
Johan Hakkesteegt31-Jul-09 0:36 
GeneralRe: Click once deployment error Pin
Member 254181431-Jul-09 4:43
Member 254181431-Jul-09 4:43 
GeneralRe: Click once deployment error Pin
Dave Kreskowiak31-Jul-09 5:09
mveDave Kreskowiak31-Jul-09 5:09 
QuestionVB .NET equivalent for C code Pin
juniortanamati30-Jul-09 8:22
juniortanamati30-Jul-09 8:22 
AnswerRe: VB .NET equivalent for C code Pin
Dave Kreskowiak30-Jul-09 10:42
mveDave Kreskowiak30-Jul-09 10:42 
AnswerRe: VB .NET equivalent for C code Pin
Dave Doknjas30-Jul-09 14:11
Dave Doknjas30-Jul-09 14:11 
QuestionVS 2003 to VS 2008 - Can not load type library Pin
No-e30-Jul-09 7:32
No-e30-Jul-09 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.